Changeset View
Changeset View
Standalone View
Standalone View
kcms/style/package/contents/ui/EffectSettingsPopup.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2018 Kai Uwe Broulik <kde@privat.broulik.de> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2 of | ||||
7 | * the License or (at your option) version 3 or any later version | ||||
8 | * accepted by the membership of KDE e.V. (or its successor approved | ||||
9 | * by the membership of KDE e.V.), which shall act as a proxy | ||||
10 | * defined in Section 14 of version 3 of the license. | ||||
11 | * | ||||
12 | * This program is distributed in the hope that it will be useful, | ||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | * GNU General Public License for more details. | ||||
16 | * | ||||
17 | * You should have received a copy of the GNU General Public License | ||||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | */ | ||||
20 | | ||||
21 | import QtQuick 2.7 | ||||
22 | import QtQuick.Layouts 1.1 | ||||
23 | import QtQuick.Controls 2.3 as QtControls | ||||
24 | import org.kde.kirigami 2.4 as Kirigami | ||||
25 | import org.kde.private.kcms.style 1.0 as Private | ||||
26 | | ||||
27 | QtControls.Popup { | ||||
28 | id: effectSettingsPopup | ||||
29 | | ||||
30 | modal: true | ||||
31 | | ||||
32 | onOpened: { | ||||
33 | // can we do this automatically with "focus: true" somewhere? | ||||
34 | iconsOnButtonsCheckBox.forceActiveFocus(); | ||||
35 | } | ||||
36 | | ||||
37 | Kirigami.FormLayout { | ||||
38 | // Popup's autosizing causes FormLayout to collapse when opening it a second time :( | ||||
39 | wideMode: true | ||||
40 | | ||||
41 | QtControls.CheckBox { | ||||
42 | id: iconsOnButtonsCheckBox | ||||
43 | Kirigami.FormData.label: i18n("Show icons:") | ||||
44 | text: i18n("On buttons") | ||||
45 | checked: kcm.iconsOnButtons | ||||
46 | onClicked: kcm.iconsOnButtons = checked | ||||
47 | } | ||||
48 | | ||||
49 | QtControls.CheckBox { | ||||
50 | text: i18n("In menus") | ||||
51 | checked: kcm.iconsInMenus | ||||
52 | onClicked: kcm.iconsInMenus = checked | ||||
53 | } | ||||
54 | | ||||
55 | QtControls.ComboBox { | ||||
56 | id: mainToolBarStyleCombo | ||||
57 | Kirigami.FormData.label: i18n("Main toolbar label:") | ||||
58 | model: [ | ||||
59 | {text: i18n("None"), value: Private.KCM.NoText}, | ||||
60 | {text: i18n("Text only"), value: Private.KCM.TextOnly}, | ||||
61 | {text: i18n("Beside icons"), value: Private.KCM.TextBesideIcon}, | ||||
62 | {text: i18n("Below icon"), value: Private.KCM.TextUnderIcon} | ||||
63 | ] | ||||
64 | textRole: "text" | ||||
65 | currentIndex: model.findIndex(function (item) { | ||||
66 | return item.value === kcm.mainToolBarStyle | ||||
67 | }) | ||||
68 | onActivated: kcm.mainToolBarStyle = model[currentIndex].value | ||||
69 | } | ||||
70 | | ||||
71 | QtControls.ComboBox { | ||||
72 | Kirigami.FormData.label: i18n("Secondary toolbar label:") | ||||
73 | model: mainToolBarStyleCombo.model | ||||
74 | textRole: "text" | ||||
75 | currentIndex: model.findIndex(function (item) { | ||||
76 | return item.value === kcm.otherToolBarStyle | ||||
77 | }) | ||||
78 | onActivated: kcm.otherToolBarStyle = model[currentIndex].value | ||||
79 | } | ||||
80 | } | ||||
81 | } |