Changeset View
Changeset View
Standalone View
Standalone View
kcms/colors/package/contents/ui/main.qml
Show All 18 Lines | |||||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.6 | 21 | import QtQuick 2.6 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 | ||
23 | import QtQuick.Window 2.2 | 23 | import QtQuick.Window 2.2 | ||
24 | import QtQuick.Dialogs 1.0 as QtDialogs | 24 | import QtQuick.Dialogs 1.0 as QtDialogs | ||
25 | import QtQuick.Controls 2.3 as QtControls | 25 | import QtQuick.Controls 2.3 as QtControls | ||
26 | import org.kde.kirigami 2.4 as Kirigami | 26 | import org.kde.kirigami 2.4 as Kirigami | ||
27 | import org.kde.kconfig 1.0 // for KAuthorized | 27 | import org.kde.newstuff 1.62 as NewStuff | ||
28 | import org.kde.kcm 1.1 as KCM | 28 | import org.kde.kcm 1.1 as KCM | ||
29 | import org.kde.private.kcms.colors 1.0 as Private | 29 | import org.kde.private.kcms.colors 1.0 as Private | ||
30 | 30 | | |||
31 | KCM.GridViewKCM { | 31 | KCM.GridViewKCM { | ||
32 | id: root | 32 | id: root | ||
33 | KCM.ConfigModule.quickHelp: i18n("This module lets you choose the color scheme.") | 33 | KCM.ConfigModule.quickHelp: i18n("This module lets you choose the color scheme.") | ||
34 | 34 | | |||
35 | view.model: kcm.filteredModel | 35 | view.model: kcm.filteredModel | ||
Show All 11 Lines | 44 | Binding { | |||
47 | value: filterCombo.model[filterCombo.currentIndex].filter | 47 | value: filterCombo.model[filterCombo.currentIndex].filter | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | enabled: !kcm.downloadingFile && !kcm.colorsSettings.isImmutable("colorScheme") | 50 | enabled: !kcm.downloadingFile && !kcm.colorsSettings.isImmutable("colorScheme") | ||
51 | 51 | | |||
52 | Component.onCompleted: { | 52 | Component.onCompleted: { | ||
53 | // The thumbnails are a bit more elaborate and need more room, especially when translated | 53 | // The thumbnails are a bit more elaborate and need more room, especially when translated | ||
54 | view.implicitCellWidth = Kirigami.Units.gridUnit * 13; | 54 | view.implicitCellWidth = Kirigami.Units.gridUnit * 13; | ||
55 | view.implicitCellHeight = Kirigami.Units.gridUnit * 11; | 55 | view.implicitCellHeight = Kirigami.Units.gridUnit * 12; | ||
56 | } | 56 | } | ||
57 | 57 | | |||
58 | DropArea { | 58 | DropArea { | ||
59 | anchors.fill: parent | 59 | anchors.fill: parent | ||
60 | onEntered: { | 60 | onEntered: { | ||
61 | if (!drag.hasUrls) { | 61 | if (!drag.hasUrls) { | ||
62 | drag.accepted = false; | 62 | drag.accepted = false; | ||
63 | } | 63 | } | ||
▲ Show 20 Lines • Show All 279 Lines • ▼ Show 20 Line(s) | 342 | RowLayout { | |||
343 | Layout.alignment: Qt.AlignRight | 343 | Layout.alignment: Qt.AlignRight | ||
344 | 344 | | |||
345 | QtControls.Button { | 345 | QtControls.Button { | ||
346 | text: i18n("Install from File...") | 346 | text: i18n("Install from File...") | ||
347 | icon.name: "document-import" | 347 | icon.name: "document-import" | ||
348 | onClicked: fileDialogLoader.active = true | 348 | onClicked: fileDialogLoader.active = true | ||
349 | } | 349 | } | ||
350 | 350 | | |||
351 | QtControls.Button { | 351 | NewStuff.Button { | ||
352 | text: i18n("Get New Color Schemes...") | 352 | id: newStuffButton | ||
353 | icon.name: "get-hot-new-stuff" | 353 | downloadNewWhat: i18n("Color Schemes") | ||
354 | onClicked: kcm.getNewStuff(this) | 354 | configFile: "colorschemes.knsrc" | ||
355 | visible: KAuthorized.authorize("ghns") | 355 | viewMode: NewStuff.Page.ViewMode.Tiles | ||
356 | onChangedEntriesChanged: kcm.reloadModel(newStuffButton.changedEntries); | ||||
356 | } | 357 | } | ||
357 | } | 358 | } | ||
358 | } | 359 | } | ||
359 | 360 | | |||
360 | Loader { | 361 | Loader { | ||
361 | id: fileDialogLoader | 362 | id: fileDialogLoader | ||
362 | active: false | 363 | active: false | ||
363 | sourceComponent: QtDialogs.FileDialog { | 364 | sourceComponent: QtDialogs.FileDialog { | ||
Show All 15 Lines |