Changeset View
Changeset View
Standalone View
Standalone View
kcms/desktoptheme/package/contents/ui/main.qml
Show All 17 Lines | 1 | /* | |||
---|---|---|---|---|---|
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
19 | Boston, MA 02110-1301, USA. | 19 | Boston, MA 02110-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | import QtQuick 2.1 | 22 | import QtQuick 2.1 | ||
23 | import QtQuick.Layouts 1.1 | 23 | import QtQuick.Layouts 1.1 | ||
24 | import QtQuick.Dialogs 1.0 | 24 | import QtQuick.Dialogs 1.0 | ||
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.8 as Kirigami | ||
27 | import org.kde.newstuff 1.62 as NewStuff | 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.desktoptheme 1.0 as Private | 29 | import org.kde.private.kcms.desktoptheme 1.0 as Private | ||
30 | 30 | | |||
31 | 31 | | |||
32 | KCM.GridViewKCM { | 32 | KCM.GridViewKCM { | ||
33 | KCM.ConfigModule.quickHelp: i18n("This module lets you choose the Plasma style.") | 33 | KCM.ConfigModule.quickHelp: i18n("This module lets you choose the Plasma style.") | ||
34 | 34 | | |||
Show All 21 Lines | 55 | if (!drag.hasUrls) { | |||
56 | drag.accepted = false; | 56 | drag.accepted = false; | ||
57 | } | 57 | } | ||
58 | } | 58 | } | ||
59 | onDropped: kcm.installThemeFromFile(drop.urls[0]) | 59 | onDropped: kcm.installThemeFromFile(drop.urls[0]) | ||
60 | } | 60 | } | ||
61 | header: RowLayout { | 61 | header: RowLayout { | ||
62 | Layout.fillWidth: true | 62 | Layout.fillWidth: true | ||
63 | 63 | | |||
64 | QtControls.TextField { | 64 | Kirigami.SearchField { | ||
65 | id: searchField | 65 | id: searchField | ||
66 | Layout.fillWidth: true | 66 | Layout.fillWidth: true | ||
67 | placeholderText: i18n("Search...") | | |||
68 | leftPadding: LayoutMirroring.enabled ? clearButton.width : undefined | | |||
69 | rightPadding: LayoutMirroring.enabled ? undefined : clearButton.width | | |||
70 | // this could be useful as a component | | |||
71 | MouseArea { | | |||
72 | id: clearButton | | |||
73 | anchors { | | |||
74 | top: parent.top | | |||
75 | topMargin: parent.topPadding | | |||
76 | right: parent.right | | |||
77 | // the TextField's padding is taking into account the clear button's size | | |||
78 | // so we just use the opposite one for positioning the clear button | | |||
79 | rightMargin: LayoutMirroring.enabled ? parent.rightPadding: parent.leftPadding | | |||
80 | bottom: parent.bottom | | |||
81 | bottomMargin: parent.bottomPadding | | |||
82 | } | | |||
83 | width: height | | |||
84 | | ||||
85 | opacity: searchField.length > 0 ? 1 : 0 | | |||
86 | onClicked: searchField.clear() | | |||
87 | | ||||
88 | Kirigami.Icon { | | |||
89 | anchors.fill: parent | | |||
90 | active: parent.pressed | | |||
91 | source: "edit-clear-locationbar-" + (LayoutMirroring.enabled ? "ltr" : "rtl") | | |||
92 | } | | |||
93 | | ||||
94 | Behavior on opacity { | | |||
95 | NumberAnimation { duration: Kirigami.Units.longDuration } | | |||
96 | } | | |||
97 | } | | |||
98 | } | 67 | } | ||
99 | QtControls.ComboBox { | 68 | QtControls.ComboBox { | ||
100 | id: filterCombo | 69 | id: filterCombo | ||
101 | textRole: "text" | 70 | textRole: "text" | ||
102 | model: [ | 71 | model: [ | ||
103 | {text: i18n("All Themes"), filter: Private.FilterProxyModel.AllThemes}, | 72 | {text: i18n("All Themes"), filter: Private.FilterProxyModel.AllThemes}, | ||
104 | {text: i18n("Light Themes"), filter: Private.FilterProxyModel.LightThemes}, | 73 | {text: i18n("Light Themes"), filter: Private.FilterProxyModel.LightThemes}, | ||
105 | {text: i18n("Dark Themes"), filter: Private.FilterProxyModel.DarkThemes}, | 74 | {text: i18n("Dark Themes"), filter: Private.FilterProxyModel.DarkThemes}, | ||
▲ Show 20 Lines • Show All 131 Lines • Show Last 20 Lines |