Changeset View
Changeset View
Standalone View
Standalone View
desktoppackage/contents/configuration/AppletConfiguration.qml
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.0 | 19 | import QtQuick 2.6 | ||
20 | import QtQuick.Dialogs 1.1 | 20 | import QtQuick.Dialogs 1.1 | ||
21 | import QtQuick.Controls 1.3 as QtControls | 21 | import QtQuick.Controls 2.3 as QtControls | ||
22 | import QtQuick.Layouts 1.0 | 22 | import QtQuick.Layouts 1.0 | ||
23 | import QtQuick.Window 2.2 | 23 | import QtQuick.Window 2.2 | ||
24 | 24 | | |||
25 | import org.kde.kirigami 2.5 as Kirigami | ||||
25 | import org.kde.plasma.core 2.1 as PlasmaCore | 26 | import org.kde.plasma.core 2.1 as PlasmaCore | ||
26 | import org.kde.plasma.configuration 2.0 | 27 | import org.kde.plasma.configuration 2.0 | ||
27 | 28 | | |||
28 | 29 | | |||
29 | //TODO: all of this will be done with desktop components | 30 | //TODO: all of this will be done with desktop components | ||
30 | Rectangle { | 31 | Rectangle { | ||
31 | id: root | 32 | id: root | ||
32 | Layout.minimumWidth: units.gridUnit * 30 | 33 | Layout.minimumWidth: units.gridUnit * 30 | ||
33 | Layout.minimumHeight: units.gridUnit * 20 | 34 | Layout.minimumHeight: units.gridUnit * 20 | ||
34 | 35 | | |||
35 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | 36 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | ||
36 | LayoutMirroring.childrenInherit: true | 37 | LayoutMirroring.childrenInherit: true | ||
37 | 38 | | |||
38 | //BEGIN properties | 39 | //BEGIN properties | ||
39 | color: syspal.window | 40 | color: Kirigami.Theme.backgroundColor | ||
40 | width: units.gridUnit * 40 | 41 | width: units.gridUnit * 40 | ||
41 | height: units.gridUnit * 30 | 42 | height: units.gridUnit * 30 | ||
42 | 43 | | |||
43 | property bool isContainment: false | 44 | property bool isContainment: false | ||
44 | //END properties | 45 | //END properties | ||
45 | 46 | | |||
46 | //BEGIN model | 47 | //BEGIN model | ||
47 | property ConfigModel globalConfigModel: globalAppletConfigModel | 48 | property ConfigModel globalConfigModel: globalAppletConfigModel | ||
Show All 12 Lines | 59 | PlasmaCore.SortFilterModel { | |||
60 | sourceModel: configDialog.configModel | 61 | sourceModel: configDialog.configModel | ||
61 | filterRole: "visible" | 62 | filterRole: "visible" | ||
62 | filterCallback: function(source_row, value) { return value; } | 63 | filterCallback: function(source_row, value) { return value; } | ||
63 | } | 64 | } | ||
64 | //END model | 65 | //END model | ||
65 | 66 | | |||
66 | //BEGIN functions | 67 | //BEGIN functions | ||
67 | function saveConfig() { | 68 | function saveConfig() { | ||
68 | if (main.currentItem.saveConfig) { | 69 | if (pageStack.currentItem.saveConfig) { | ||
69 | main.currentItem.saveConfig() | 70 | pageStack.currentItem.saveConfig() | ||
70 | } | 71 | } | ||
71 | for (var key in plasmoid.configuration) { | 72 | for (var key in plasmoid.configuration) { | ||
72 | if (main.currentItem["cfg_"+key] !== undefined) { | 73 | if (pageStack.currentItem["cfg_"+key] !== undefined) { | ||
73 | plasmoid.configuration[key] = main.currentItem["cfg_"+key] | 74 | plasmoid.configuration[key] = pageStack.currentItem["cfg_"+key] | ||
74 | } | 75 | } | ||
75 | } | 76 | } | ||
76 | } | 77 | } | ||
77 | 78 | | |||
78 | function settingValueChanged() { | 79 | function settingValueChanged() { | ||
79 | applyButton.enabled = true; | 80 | applyButton.enabled = true; | ||
80 | } | 81 | } | ||
81 | //END functions | 82 | //END functions | ||
82 | 83 | | |||
83 | 84 | | |||
84 | //BEGIN connections | 85 | //BEGIN connections | ||
85 | Component.onCompleted: { | 86 | Component.onCompleted: { | ||
86 | if (!isContainment && configDialog.configModel && configDialog.configModel.count > 0) { | 87 | if (!isContainment && configDialog.configModel && configDialog.configModel.count > 0) { | ||
87 | if (configDialog.configModel.get(0).source) { | 88 | if (configDialog.configModel.get(0).source) { | ||
88 | main.sourceFile = configDialog.configModel.get(0).source | 89 | pageStack.sourceFile = configDialog.configModel.get(0).source | ||
89 | } else if (configDialog.configModel.get(0).kcm) { | 90 | } else if (configDialog.configModel.get(0).kcm) { | ||
90 | main.sourceFile = Qt.resolvedUrl("ConfigurationKcmPage.qml"); | 91 | pageStack.sourceFile = Qt.resolvedUrl("ConfigurationKcmPage.qml"); | ||
91 | main.currentItem.kcm = configDialog.configModel.get(0).kcm; | 92 | pageStack.currentItem.kcm = configDialog.configModel.get(0).kcm; | ||
92 | } else { | 93 | } else { | ||
93 | main.sourceFile = ""; | 94 | pageStack.sourceFile = ""; | ||
94 | } | 95 | } | ||
95 | main.title = configDialog.configModel.get(0).name | 96 | pageStack.title = configDialog.configModel.get(0).name | ||
96 | } else { | 97 | } else { | ||
97 | main.sourceFile = globalConfigModel.get(0).source | 98 | pageStack.sourceFile = globalConfigModel.get(0).source | ||
98 | main.title = globalConfigModel.get(0).name | 99 | pageStack.title = globalConfigModel.get(0).name | ||
99 | } | 100 | } | ||
100 | // root.width = mainColumn.implicitWidth | 101 | // root.width = pageStackColumn.implicitWidth | ||
101 | // root.height = mainColumn.implicitHeight | 102 | // root.height = pageStackColumn.implicitHeight | ||
102 | } | 103 | } | ||
103 | //END connections | 104 | //END connections | ||
104 | 105 | | |||
105 | //BEGIN UI components | 106 | //BEGIN UI components | ||
106 | SystemPalette {id: syspal} | | |||
107 | | ||||
108 | MessageDialog { | 107 | MessageDialog { | ||
109 | id: messageDialog | 108 | id: messageDialog | ||
110 | icon: StandardIcon.Warning | 109 | icon: StandardIcon.Warning | ||
111 | property Item delegate | 110 | property Item delegate | ||
112 | title: i18nd("plasma_shell_org.kde.plasma.desktop", "Apply Settings") | 111 | title: i18nd("plasma_shell_org.kde.plasma.desktop", "Apply Settings") | ||
113 | text: i18nd("plasma_shell_org.kde.plasma.desktop", "The settings of the current module have changed. Do you want to apply the changes or discard them?") | 112 | text: i18nd("plasma_shell_org.kde.plasma.desktop", "The settings of the current module have changed. Do you want to apply the changes or discard them?") | ||
114 | standardButtons: StandardButton.Apply | StandardButton.Discard | StandardButton.Cancel | 113 | standardButtons: StandardButton.Apply | StandardButton.Discard | StandardButton.Cancel | ||
115 | onApply: { | 114 | onApply: { | ||
116 | applyAction.trigger() | 115 | applyAction.trigger() | ||
117 | delegate.openCategory() | 116 | delegate.openCategory() | ||
118 | } | 117 | } | ||
119 | onDiscard: { | 118 | onDiscard: { | ||
120 | delegate.openCategory() | 119 | delegate.openCategory() | ||
121 | } | 120 | } | ||
122 | } | 121 | } | ||
123 | 122 | | |||
124 | ColumnLayout { | 123 | ColumnLayout { | ||
125 | id: mainColumn | 124 | id: pageStackColumn | ||
126 | anchors { | 125 | anchors { | ||
127 | fill: parent | 126 | fill: parent | ||
128 | margins: mainColumn.spacing * units.devicePixelRatio //margins are hardcoded in QStyle we should match that here | 127 | margins: pageStackColumn.spacing * units.devicePixelRatio //margins are hardcoded in QStyle we should match that here | ||
129 | } | 128 | } | ||
130 | property int implicitWidth: Math.max(contentRow.implicitWidth, buttonsRow.implicitWidth) + 8 | 129 | property int implicitWidth: Math.max(contentRow.implicitWidth, buttonsRow.implicitWidth) + 8 | ||
131 | property int implicitHeight: contentRow.implicitHeight + buttonsRow.implicitHeight + 8 | 130 | property int implicitHeight: contentRow.implicitHeight + buttonsRow.implicitHeight + 8 | ||
132 | 131 | | |||
133 | RowLayout { | 132 | RowLayout { | ||
134 | id: contentRow | 133 | id: contentRow | ||
135 | spacing: 0 | 134 | spacing: 0 | ||
136 | Layout.fillWidth: true | 135 | Layout.fillWidth: true | ||
137 | Layout.fillHeight: true | 136 | Layout.fillHeight: true | ||
138 | Layout.preferredHeight: parent.height - buttonsRow.height | 137 | Layout.preferredHeight: parent.height - buttonsRow.height | ||
139 | 138 | | |||
140 | QtControls.ScrollView { | 139 | QtControls.ScrollView { | ||
141 | id: categoriesScroll | 140 | id: categoriesScroll | ||
142 | frameVisible: false | 141 | QtControls.ScrollBar.horizontal.policy: QtControls.ScrollBar.AlwaysOff | ||
143 | horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff | | |||
144 | Layout.fillHeight: true | 142 | Layout.fillHeight: true | ||
145 | visible: (configDialog.configModel ? configDialog.configModel.count : 0) + globalConfigModel.count > 1 | 143 | visible: (configDialog.configModel ? configDialog.configModel.count : 0) + globalConfigModel.count > 1 | ||
146 | Layout.maximumWidth: units.gridUnit * 7 | 144 | Layout.maximumWidth: units.gridUnit * 7 | ||
147 | Layout.preferredWidth: categories.implicitWidth | 145 | Layout.preferredWidth: categories.implicitWidth | ||
148 | flickableItem.interactive: false | | |||
149 | 146 | | |||
150 | Keys.onUpPressed: { | 147 | Keys.onUpPressed: { | ||
151 | var buttons = categories.children | 148 | var buttons = categories.children | ||
152 | 149 | | |||
153 | var foundPrevious = false | 150 | var foundPrevious = false | ||
154 | for (var i = buttons.length - 1; i >= 0; --i) { | 151 | for (var i = buttons.length - 1; i >= 0; --i) { | ||
155 | var button = buttons[i]; | 152 | var button = buttons[i]; | ||
156 | if (!button.hasOwnProperty("current")) { | 153 | if (!button.hasOwnProperty("current")) { | ||
Show All 28 Lines | 181 | } else if (button.current) { | |||
185 | foundNext = true | 182 | foundNext = true | ||
186 | } | 183 | } | ||
187 | } | 184 | } | ||
188 | } | 185 | } | ||
189 | 186 | | |||
190 | ColumnLayout { | 187 | ColumnLayout { | ||
191 | id: categories | 188 | id: categories | ||
192 | spacing: 0 | 189 | spacing: 0 | ||
193 | width: categoriesScroll.viewport.width | 190 | width: categoriesScroll.width | ||
194 | 191 | | |||
195 | property Item currentItem: children[1] | 192 | property Item currentItem: children[1] | ||
196 | 193 | | |||
197 | Repeater { | 194 | Repeater { | ||
198 | model: root.isContainment ? globalConfigModel : undefined | 195 | model: root.isContainment ? globalConfigModel : undefined | ||
199 | delegate: ConfigCategoryDelegate {} | 196 | delegate: ConfigCategoryDelegate {} | ||
200 | } | 197 | } | ||
201 | Repeater { | 198 | Repeater { | ||
202 | model: configDialogFilterModel | 199 | model: configDialogFilterModel | ||
203 | delegate: ConfigCategoryDelegate {} | 200 | delegate: ConfigCategoryDelegate {} | ||
204 | } | 201 | } | ||
205 | Repeater { | 202 | Repeater { | ||
206 | model: !root.isContainment ? globalConfigModel : undefined | 203 | model: !root.isContainment ? globalConfigModel : undefined | ||
207 | delegate: ConfigCategoryDelegate {} | 204 | delegate: ConfigCategoryDelegate {} | ||
208 | } | 205 | } | ||
209 | } | 206 | } | ||
210 | } | 207 | } | ||
211 | 208 | | |||
212 | Rectangle { | 209 | Rectangle { | ||
213 | Layout.fillHeight: true | 210 | Layout.fillHeight: true | ||
214 | width: Math.round(units.devicePixelRatio) | 211 | width: Math.round(units.devicePixelRatio) | ||
215 | color: syspal.highlight | 212 | color: Kirigami.Theme.highlightColor | ||
216 | visible: categoriesScroll.visible | 213 | visible: categoriesScroll.visible | ||
217 | opacity: categoriesScroll.activeFocus && Window.active ? 1 : 0.3 | 214 | opacity: categoriesScroll.activeFocus && Window.active ? 1 : 0.3 | ||
218 | Behavior on color { | 215 | Behavior on color { | ||
219 | ColorAnimation { | 216 | ColorAnimation { | ||
220 | duration: units.longDuration | 217 | duration: units.longDuration | ||
221 | easing.type: Easing.InOutQuad | 218 | easing.type: Easing.InOutQuad | ||
222 | } | 219 | } | ||
223 | } | 220 | } | ||
224 | } | 221 | } | ||
225 | 222 | | |||
226 | Item { // spacer | 223 | Item { // spacer | ||
227 | width: units.largeSpacing | 224 | width: units.largeSpacing | ||
228 | visible: categoriesScroll.visible | 225 | visible: categoriesScroll.visible | ||
229 | } | 226 | } | ||
230 | 227 | | |||
231 | QtControls.ScrollView { | 228 | QtControls.ScrollView { | ||
232 | id: scroll | 229 | id: scroll | ||
233 | Layout.fillHeight: true | 230 | Layout.fillHeight: true | ||
234 | Layout.fillWidth: true | 231 | Layout.fillWidth: true | ||
235 | // we want to focus the controls in the settings page right away, don't focus the ScrollView | 232 | // we want to focus the controls in the settings page right away, don't focus the ScrollView | ||
236 | activeFocusOnTab: false | 233 | activeFocusOnTab: false | ||
237 | 234 | | |||
235 | property Item flickableItem: pageFlickable | ||||
238 | // this horrible code below ensures the control with active focus stays visible in the window | 236 | // this horrible code below ensures the control with active focus stays visible in the window | ||
239 | // by scrolling the view up or down as needed when tabbing through the window | 237 | // by scrolling the view up or down as needed when tabbing through the window | ||
240 | Window.onActiveFocusItemChanged: { | 238 | Window.onActiveFocusItemChanged: { | ||
241 | var flickable = scroll.flickableItem; | 239 | var flickable = scroll.flickableItem; | ||
242 | 240 | | |||
243 | var item = Window.activeFocusItem; | 241 | var item = Window.activeFocusItem; | ||
244 | if (!item) { | 242 | if (!item) { | ||
245 | return; | 243 | return; | ||
Show All 15 Lines | |||||
261 | // when it's barely visible. The logic was mostly meant for keyboard navigating through | 259 | // when it's barely visible. The logic was mostly meant for keyboard navigating through | ||
262 | // a list of CheckBoxes, so this check keeps us from trying to scroll an inner ScrollView | 260 | // a list of CheckBoxes, so this check keeps us from trying to scroll an inner ScrollView | ||
263 | // into view when it implicitly gains focus (like plasma-pa config dialog has). | 261 | // into view when it implicitly gains focus (like plasma-pa config dialog has). | ||
264 | } else if (yPos + Math.min(padding, item.height) > flickable.contentY + flickable.height) { | 262 | } else if (yPos + Math.min(padding, item.height) > flickable.contentY + flickable.height) { | ||
265 | flickable.contentY = Math.min(flickable.contentHeight - flickable.height, | 263 | flickable.contentY = Math.min(flickable.contentHeight - flickable.height, | ||
266 | yPos - flickable.height + item.height + padding); | 264 | yPos - flickable.height + item.height + padding); | ||
267 | } | 265 | } | ||
268 | } | 266 | } | ||
269 | 267 | Flickable { | |||
268 | id: pageFlickable | ||||
269 | anchors.fill: parent | ||||
270 | contentHeight: pageColumn.height | ||||
271 | contentWidth: width | ||||
270 | Column { | 272 | Column { | ||
273 | id: pageColumn | ||||
271 | spacing: units.largeSpacing / 2 | 274 | spacing: units.largeSpacing / 2 | ||
272 | 275 | | |||
273 | QtControls.Label { | 276 | Kirigami.Heading { | ||
274 | id: pageTitle | 277 | id: pageTitle | ||
275 | width: scroll.viewport.width | 278 | width: scroll.width | ||
276 | font.pointSize: theme.defaultFont.pointSize*2 | 279 | level: 1 | ||
277 | font.weight: Font.Light | 280 | text: pageStack.title | ||
278 | text: main.title | | |||
279 | } | 281 | } | ||
280 | 282 | | |||
281 | QtControls.StackView { | 283 | QtControls.StackView { | ||
282 | id: main | 284 | id: pageStack | ||
283 | property string title: "" | 285 | property string title: "" | ||
284 | property bool invertAnimations: false | 286 | property bool invertAnimations: false | ||
285 | 287 | | |||
286 | height: Math.max((scroll.viewport.height - pageTitle.height - parent.spacing), (main.currentItem ? (main.currentItem.implicitHeight ? main.currentItem.implicitHeight : main.currentItem.childrenRect.height) : 0)) | 288 | height: Math.max((scroll.height - pageTitle.height - parent.spacing), (pageStack.currentItem ? (pageStack.currentItem.implicitHeight ? pageStack.currentItem.implicitHeight : pageStack.currentItem.childrenRect.height) : 0)) | ||
287 | width: scroll.viewport.width | 289 | width: scroll.width | ||
288 | 290 | | |||
289 | property string sourceFile | 291 | property string sourceFile | ||
290 | 292 | | |||
291 | onSourceFileChanged: { | 293 | onSourceFileChanged: { | ||
292 | if (!sourceFile) { | 294 | if (!sourceFile) { | ||
293 | return; | 295 | return; | ||
294 | } | 296 | } | ||
295 | 297 | | |||
296 | var props = {} | 298 | //in a StackView pages need to be initialized with stackviews size, or have none | ||
299 | var props = {"width": width, "height": height} | ||||
297 | 300 | | |||
298 | var plasmoidConfig = plasmoid.configuration | 301 | var plasmoidConfig = plasmoid.configuration | ||
299 | for (var key in plasmoidConfig) { | 302 | for (var key in plasmoidConfig) { | ||
300 | props["cfg_" + key] = plasmoid.configuration[key] | 303 | props["cfg_" + key] = plasmoid.configuration[key] | ||
301 | } | 304 | } | ||
302 | 305 | | |||
303 | var newItem = push({ | 306 | var newItem = replace(Qt.resolvedUrl(sourceFile), props) | ||
304 | item: Qt.resolvedUrl(sourceFile), | | |||
305 | replace: true, | | |||
306 | properties: props | | |||
307 | }) | | |||
308 | 307 | | |||
309 | for (var key in plasmoidConfig) { | 308 | for (var key in plasmoidConfig) { | ||
310 | var changedSignal = newItem["cfg_" + key + "Changed"] | 309 | var changedSignal = newItem["cfg_" + key + "Changed"] | ||
311 | if (changedSignal) { | 310 | if (changedSignal) { | ||
312 | changedSignal.connect(root.settingValueChanged) | 311 | changedSignal.connect(root.settingValueChanged) | ||
313 | } | 312 | } | ||
314 | } | 313 | } | ||
315 | 314 | | |||
Show All 10 Lines | |||||
326 | 325 | | |||
327 | for (var prop in currentItem) { | 326 | for (var prop in currentItem) { | ||
328 | if (prop.indexOf("cfg_") === 0) { | 327 | if (prop.indexOf("cfg_") === 0) { | ||
329 | currentItem[prop+"Changed"].connect(root.pageChanged) | 328 | currentItem[prop+"Changed"].connect(root.pageChanged) | ||
330 | } | 329 | } | ||
331 | }*/ | 330 | }*/ | ||
332 | } | 331 | } | ||
333 | 332 | | |||
334 | delegate: QtControls.StackViewDelegate { | 333 | replaceEnter: Transition { | ||
335 | function transitionFinished(properties) | 334 | ParallelAnimation { | ||
336 | { | 335 | //OpacityAnimator when starting from 0 is buggy (it shows one frame with opacity 1) | ||
337 | properties.exitItem.opacity = 1 | 336 | NumberAnimation { | ||
338 | } | | |||
339 | | ||||
340 | pushTransition: QtControls.StackViewTransition { | | |||
341 | PropertyAnimation { | | |||
342 | target: enterItem | | |||
343 | property: "opacity" | 337 | property: "opacity" | ||
344 | from: 0 | 338 | from: 0 | ||
345 | to: 1 | 339 | to: 1 | ||
346 | duration: units.longDuration | 340 | duration: units.longDuration | ||
347 | easing.type: Easing.InOutQuad | 341 | easing.type: Easing.InOutQuad | ||
348 | } | 342 | } | ||
349 | PropertyAnimation { | 343 | XAnimator { | ||
350 | target: enterItem | 344 | from: pageStack.invertAnimations ? -scroll.width/3: scroll.width/3 | ||
351 | property: "x" | | |||
352 | from: main.invertAnimations ? -target.width/3: target.width/3 | | |||
353 | to: 0 | 345 | to: 0 | ||
354 | duration: units.longDuration | 346 | duration: units.longDuration | ||
355 | easing.type: Easing.InOutQuad | 347 | easing.type: Easing.InOutQuad | ||
356 | } | 348 | } | ||
357 | PropertyAnimation { | 349 | } | ||
358 | target: exitItem | 350 | } | ||
359 | property: "opacity" | 351 | replaceExit: Transition { | ||
352 | ParallelAnimation { | ||||
353 | OpacityAnimator { | ||||
360 | from: 1 | 354 | from: 1 | ||
361 | to: 0 | 355 | to: 0 | ||
362 | duration: units.longDuration | 356 | duration: units.longDuration | ||
363 | easing.type: Easing.InOutQuad | 357 | easing.type: Easing.InOutQuad | ||
364 | } | 358 | } | ||
365 | PropertyAnimation { | 359 | XAnimator { | ||
366 | target: exitItem | | |||
367 | property: "x" | | |||
368 | from: 0 | 360 | from: 0 | ||
369 | to: main.invertAnimations ? target.width/3 : -target.width/3 | 361 | to: pageStack.invertAnimations ? scroll.width/3 : -scroll.width/3 | ||
370 | duration: units.longDuration | 362 | duration: units.longDuration | ||
371 | easing.type: Easing.InOutQuad | 363 | easing.type: Easing.InOutQuad | ||
372 | } | 364 | } | ||
373 | } | 365 | } | ||
374 | } | 366 | } | ||
375 | } | 367 | } | ||
376 | } | 368 | } | ||
377 | } | 369 | } | ||
378 | } | 370 | } | ||
371 | } | ||||
379 | 372 | | |||
380 | QtControls.Action { | 373 | QtControls.Action { | ||
381 | id: acceptAction | 374 | id: acceptAction | ||
382 | onTriggered: { | 375 | onTriggered: { | ||
383 | applyAction.trigger(); | 376 | applyAction.trigger(); | ||
384 | configDialog.close(); | 377 | configDialog.close(); | ||
385 | } | 378 | } | ||
386 | shortcut: "Return" | 379 | shortcut: "Return" | ||
Show All 13 Lines | 391 | QtControls.Action { | |||
400 | onTriggered: configDialog.close(); | 393 | onTriggered: configDialog.close(); | ||
401 | shortcut: "Escape" | 394 | shortcut: "Escape" | ||
402 | } | 395 | } | ||
403 | 396 | | |||
404 | RowLayout { | 397 | RowLayout { | ||
405 | id: buttonsRow | 398 | id: buttonsRow | ||
406 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 399 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
407 | QtControls.Button { | 400 | QtControls.Button { | ||
408 | iconName: "dialog-ok" | 401 | icon.name: "dialog-ok" | ||
409 | text: i18nd("plasma_shell_org.kde.plasma.desktop", "OK") | 402 | text: i18nd("plasma_shell_org.kde.plasma.desktop", "OK") | ||
410 | onClicked: acceptAction.trigger() | 403 | onClicked: acceptAction.trigger() | ||
411 | } | 404 | } | ||
412 | QtControls.Button { | 405 | QtControls.Button { | ||
413 | id: applyButton | 406 | id: applyButton | ||
414 | enabled: false | 407 | enabled: false | ||
415 | iconName: "dialog-ok-apply" | 408 | icon.name: "dialog-ok-apply" | ||
416 | text: i18nd("plasma_shell_org.kde.plasma.desktop", "Apply") | 409 | text: i18nd("plasma_shell_org.kde.plasma.desktop", "Apply") | ||
417 | visible: main.currentItem && (!main.currentItem.kcm || main.currentItem.kcm.buttons & 4) // 4 = Apply button | 410 | visible: pageStack.currentItem && (!pageStack.currentItem.kcm || pageStack.currentItem.kcm.buttons & 4) // 4 = Apply button | ||
418 | onClicked: applyAction.trigger() | 411 | onClicked: applyAction.trigger() | ||
419 | } | 412 | } | ||
420 | QtControls.Button { | 413 | QtControls.Button { | ||
421 | iconName: "dialog-cancel" | 414 | icon.name: "dialog-cancel" | ||
422 | text: i18nd("plasma_shell_org.kde.plasma.desktop", "Cancel") | 415 | text: i18nd("plasma_shell_org.kde.plasma.desktop", "Cancel") | ||
423 | onClicked: cancelAction.trigger() | 416 | onClicked: cancelAction.trigger() | ||
424 | } | 417 | } | ||
425 | } | 418 | } | ||
426 | } | 419 | } | ||
427 | //END UI components | 420 | //END UI components | ||
428 | } | 421 | } |