Changeset View
Changeset View
Standalone View
Standalone View
kcms/colors/package/contents/ui/main.qml
Show All 17 Lines | |||||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
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.8 as Kirigami | ||
27 | import org.kde.kconfig 1.0 // for KAuthorized | 27 | import org.kde.kconfig 1.0 // for KAuthorized | ||
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 | | |||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 83 | onShowSchemeNotInstalledWarning: { | |||
85 | notInstalledWarning.visible = true; | 85 | notInstalledWarning.visible = true; | ||
86 | } | 86 | } | ||
87 | } | 87 | } | ||
88 | } | 88 | } | ||
89 | 89 | | |||
90 | RowLayout { | 90 | RowLayout { | ||
91 | Layout.fillWidth: true | 91 | Layout.fillWidth: true | ||
92 | 92 | | |||
93 | QtControls.TextField { | 93 | Kirigami.SearchField { | ||
94 | id: searchField | 94 | id: searchField | ||
95 | Layout.fillWidth: true | 95 | Layout.fillWidth: true | ||
96 | placeholderText: i18n("Search...") | | |||
97 | leftPadding: LayoutMirroring.enabled ? clearButton.width : undefined | | |||
98 | rightPadding: LayoutMirroring.enabled ? undefined : clearButton.width | | |||
99 | | ||||
100 | // this could be useful as a component | | |||
101 | MouseArea { | | |||
102 | id: clearButton | | |||
103 | anchors { | | |||
104 | top: parent.top | | |||
105 | topMargin: parent.topPadding | | |||
106 | right: parent.right | | |||
107 | // the TextField's padding is taking into account the clear button's size | | |||
108 | // so we just use the opposite one for positioning the clear button | | |||
109 | rightMargin: LayoutMirroring.enabled ? parent.rightPadding: parent.leftPadding | | |||
110 | bottom: parent.bottom | | |||
111 | bottomMargin: parent.bottomPadding | | |||
112 | } | | |||
113 | width: height | | |||
114 | | ||||
115 | opacity: searchField.length > 0 ? 1 : 0 | | |||
116 | onClicked: searchField.clear() | | |||
117 | | ||||
118 | Kirigami.Icon { | | |||
119 | anchors.fill: parent | | |||
120 | active: parent.pressed | | |||
121 | source: "edit-clear-locationbar-" + (LayoutMirroring.enabled ? "ltr" : "rtl") | | |||
122 | } | | |||
123 | | ||||
124 | Behavior on opacity { | | |||
125 | NumberAnimation { duration: Kirigami.Units.longDuration } | | |||
126 | } | | |||
127 | } | | |||
128 | } | 96 | } | ||
129 | 97 | | |||
130 | QtControls.ComboBox { | 98 | QtControls.ComboBox { | ||
131 | id: filterCombo | 99 | id: filterCombo | ||
132 | textRole: "text" | 100 | textRole: "text" | ||
133 | model: [ | 101 | model: [ | ||
134 | {text: i18n("All Schemes"), filter: Private.KCM.AllSchemes}, | 102 | {text: i18n("All Schemes"), filter: Private.KCM.AllSchemes}, | ||
135 | {text: i18n("Light Schemes"), filter: Private.KCM.LightSchemes}, | 103 | {text: i18n("Light Schemes"), filter: Private.KCM.LightSchemes}, | ||
▲ Show 20 Lines • Show All 243 Lines • Show Last 20 Lines |