Changeset View
Changeset View
Standalone View
Standalone View
applets/pager/package/contents/ui/configGeneral.qml
Show All 11 Lines | |||||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. | ||
14 | * | 14 | * | ||
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.0 | 20 | import QtQuick 2.5 | ||
21 | import QtQuick.Controls 1.0 as QtControls | 21 | import QtQuick.Controls 2.5 as QtControls | ||
22 | import QtQuick.Layouts 1.0 as Layouts | | |||
23 | 22 | | |||
23 | import org.kde.kirigami 2.5 as Kirigami | ||||
24 | 24 | | |||
25 | //FIXME this causes a crash in Oxygen style | | |||
26 | //QtControls.GroupBox { | | |||
27 | Item { | | |||
28 | 25 | | |||
29 | width: childrenRect.width | 26 | Kirigami.FormLayout { | ||
30 | height: childrenRect.height | | |||
31 | 27 | | |||
32 | //FIXME enable when we're back to being a group box | 28 | anchors.left: parent.left | ||
33 | // flat: true | 29 | anchors.right: parent.right | ||
34 | // title: i18n("Appearance") | | |||
35 | 30 | | |||
36 | property bool isActivityPager: (plasmoid.pluginName === "org.kde.plasma.activitypager") | 31 | property bool isActivityPager: (plasmoid.pluginName === "org.kde.plasma.activitypager") | ||
37 | 32 | | |||
38 | property int cfg_displayedText | 33 | property int cfg_displayedText | ||
39 | property alias cfg_showWindowIcons: showWindowIcons.checked | 34 | property alias cfg_showWindowIcons: showWindowIcons.checked | ||
40 | property int cfg_currentDesktopSelected | 35 | property int cfg_currentDesktopSelected | ||
41 | property alias cfg_pagerLayout: pagerLayout.currentIndex | 36 | property alias cfg_pagerLayout: pagerLayout.currentIndex | ||
42 | property alias cfg_showOnlyCurrentScreen: showOnlyCurrentScreen.checked | 37 | property alias cfg_showOnlyCurrentScreen: showOnlyCurrentScreen.checked | ||
43 | property alias cfg_wrapPage: wrapPage.checked | 38 | property alias cfg_wrapPage: wrapPage.checked | ||
44 | 39 | | |||
45 | onCfg_displayedTextChanged: { | 40 | onCfg_displayedTextChanged: { | ||
46 | switch (cfg_displayedText) { | 41 | switch (cfg_displayedText) { | ||
47 | case 0: | 42 | case 0: | ||
48 | displayedTextGroup.current = desktopNumberRadio; | 43 | displayedTextGroup.checkedButton = desktopNumberRadio; | ||
49 | break; | 44 | break; | ||
50 | case 1: | 45 | case 1: | ||
51 | displayedTextGroup.current = desktopNameRadio; | 46 | displayedTextGroup.checkedButton = desktopNameRadio; | ||
52 | break; | 47 | break; | ||
53 | default: | 48 | default: | ||
54 | case 2: | 49 | case 2: | ||
55 | displayedTextGroup.current = noTextRadio; | 50 | displayedTextGroup.checkedButton = noTextRadio; | ||
56 | break; | 51 | break; | ||
57 | } | 52 | } | ||
58 | } | 53 | } | ||
59 | 54 | | |||
60 | onCfg_currentDesktopSelectedChanged: { | 55 | onCfg_currentDesktopSelectedChanged: { | ||
61 | switch (cfg_currentDesktopSelected) { | 56 | switch (cfg_currentDesktopSelected) { | ||
62 | case 0: | 57 | case 0: | ||
63 | currentDesktopSelectedGroup.current = doesNothingRadio; | 58 | currentDesktopSelectedGroup.checkedButton = doesNothingRadio; | ||
64 | break; | 59 | break; | ||
65 | case 1: | 60 | case 1: | ||
66 | currentDesktopSelectedGroup.current = showsDesktopRadio; | 61 | currentDesktopSelectedGroup.checkedButton = showsDesktopRadio; | ||
67 | break; | 62 | break; | ||
68 | default: | 63 | default: | ||
69 | break; | 64 | break; | ||
70 | } | 65 | } | ||
71 | } | 66 | } | ||
72 | 67 | | |||
73 | Component.onCompleted: { | 68 | Component.onCompleted: { | ||
74 | cfg_currentDesktopSelectedChanged(); | 69 | cfg_currentDesktopSelectedChanged(); | ||
75 | cfg_displayedTextChanged(); | 70 | cfg_displayedTextChanged(); | ||
76 | } | 71 | } | ||
77 | 72 | | |||
78 | QtControls.ExclusiveGroup { | 73 | QtControls.ButtonGroup { | ||
79 | id: displayedTextGroup | 74 | id: displayedTextGroup | ||
80 | } | 75 | } | ||
81 | QtControls.ExclusiveGroup { | 76 | QtControls.ButtonGroup { | ||
82 | id: currentDesktopSelectedGroup | 77 | id: currentDesktopSelectedGroup | ||
83 | } | 78 | } | ||
84 | 79 | | |||
85 | Layouts.GridLayout { | | |||
86 | anchors.left: parent.left | | |||
87 | columns: 2 | | |||
88 | QtControls.Label { | | |||
89 | text: i18n("Display:") | | |||
90 | Layouts.Layout.alignment: Qt.AlignVCenter|Qt.AlignRight | | |||
91 | } | | |||
92 | QtControls.RadioButton { | | |||
93 | id: desktopNumberRadio | | |||
94 | exclusiveGroup: displayedTextGroup | | |||
95 | text: isActivityPager ? i18n("Activity number") : i18n("Desktop number") | | |||
96 | onCheckedChanged: if (checked) cfg_displayedText = 0; | | |||
97 | } | | |||
98 | Item { | | |||
99 | width: 2 | | |||
100 | height: 2 | | |||
101 | Layouts.Layout.rowSpan: 2 | | |||
102 | } | | |||
103 | QtControls.RadioButton { | | |||
104 | id: desktopNameRadio | | |||
105 | exclusiveGroup: displayedTextGroup | | |||
106 | text: isActivityPager ? i18n("Activity name") : i18n("Desktop name") | | |||
107 | onCheckedChanged: if (checked) cfg_displayedText = 1; | | |||
108 | } | | |||
109 | QtControls.RadioButton { | | |||
110 | id: noTextRadio | | |||
111 | exclusiveGroup: displayedTextGroup | | |||
112 | text: i18n("No text") | | |||
113 | onCheckedChanged: if (checked) cfg_displayedText = 2; | | |||
114 | } | | |||
115 | | ||||
116 | Item { | | |||
117 | width: 2 | | |||
118 | height: 2 | | |||
119 | } //spacer | | |||
120 | 80 | | |||
121 | QtControls.CheckBox { | 81 | QtControls.CheckBox { | ||
122 | id: showWindowIcons | 82 | id: showWindowIcons | ||
123 | text: i18n("Icons") | | |||
124 | } | | |||
125 | 83 | | |||
126 | Item { | 84 | Kirigami.FormData.label: i18n("General:") | ||
127 | width: 2 | 85 | | ||
128 | height: 2 | 86 | text: i18n("Show application icons on window outlines") | ||
129 | } //spacer | 87 | } | ||
130 | 88 | | |||
131 | QtControls.CheckBox { | 89 | QtControls.CheckBox { | ||
132 | id: showOnlyCurrentScreen | 90 | id: showOnlyCurrentScreen | ||
133 | text: i18n("Only the current screen") | 91 | text: i18n("Show only current screen") | ||
134 | } | 92 | } | ||
135 | 93 | | |||
136 | Item { | | |||
137 | width: 2 | | |||
138 | height: 2 | | |||
139 | } //spacer | | |||
140 | | ||||
141 | QtControls.CheckBox { | 94 | QtControls.CheckBox { | ||
142 | id: wrapPage | 95 | id: wrapPage | ||
143 | text: i18n("Page navigation wraps around") | 96 | text: i18n("Navigation wraps around") | ||
144 | } | 97 | } | ||
145 | 98 | | |||
146 | QtControls.Label { | 99 | | ||
147 | text: i18n("Layout:") | 100 | Item { | ||
148 | Layouts.Layout.alignment: Qt.AlignVCenter|Qt.AlignRight | 101 | Kirigami.FormData.isSection: true | ||
149 | visible: isActivityPager | | |||
150 | } | 102 | } | ||
151 | 103 | | |||
104 | | ||||
152 | QtControls.ComboBox { | 105 | QtControls.ComboBox { | ||
153 | id: pagerLayout | 106 | id: pagerLayout | ||
107 | | ||||
108 | Kirigami.FormData.label: i18n("Layout:") | ||||
109 | | ||||
154 | model: [i18nc("The pager layout", "Default"), i18n("Horizontal"), i18n("Vertical")] | 110 | model: [i18nc("The pager layout", "Default"), i18n("Horizontal"), i18n("Vertical")] | ||
155 | visible: isActivityPager | 111 | visible: isActivityPager | ||
156 | } | 112 | } | ||
157 | 113 | | |||
158 | QtControls.Label { | 114 | | ||
159 | text: i18n("Selecting current desktop:") | 115 | Item { | ||
160 | Layouts.Layout.alignment: Qt.AlignVCenter|Qt.AlignRight | 116 | Kirigami.FormData.isSection: true | ||
117 | visible: isActivityPager | ||||
118 | } | ||||
119 | | ||||
120 | | ||||
121 | QtControls.RadioButton { | ||||
122 | id: noTextRadio | ||||
123 | | ||||
124 | Kirigami.FormData.label: i18n("Text display:") | ||||
125 | | ||||
126 | QtControls.ButtonGroup.group: displayedTextGroup | ||||
127 | text: i18n("No text") | ||||
128 | onCheckedChanged: if (checked) cfg_displayedText = 2; | ||||
129 | } | ||||
130 | QtControls.RadioButton { | ||||
131 | id: desktopNumberRadio | ||||
132 | QtControls.ButtonGroup.group: displayedTextGroup | ||||
133 | text: isActivityPager ? i18n("Activity number") : i18n("Desktop number") | ||||
134 | onCheckedChanged: if (checked) cfg_displayedText = 0; | ||||
161 | } | 135 | } | ||
162 | QtControls.RadioButton { | 136 | QtControls.RadioButton { | ||
GB_2: Default radio buttons should be at the top. | |||||
137 | id: desktopNameRadio | ||||
138 | QtControls.ButtonGroup.group: displayedTextGroup | ||||
139 | text: isActivityPager ? i18n("Activity name") : i18n("Desktop name") | ||||
140 | onCheckedChanged: if (checked) cfg_displayedText = 1; | ||||
141 | } | ||||
142 | | ||||
143 | | ||||
144 | Item { | ||||
145 | Kirigami.FormData.isSection: true | ||||
146 | } | ||||
147 | | ||||
148 | | ||||
149 | QtControls.RadioButton { | ||||
163 | id: doesNothingRadio | 150 | id: doesNothingRadio | ||
164 | exclusiveGroup: currentDesktopSelectedGroup | 151 | | ||
152 | Kirigami.FormData.label: isActivityPager ? i18n("Selecting current Activity:") : i18n("Selecting current virtual desktop:") | ||||
153 | | ||||
154 | QtControls.ButtonGroup.group: currentDesktopSelectedGroup | ||||
165 | text: i18n("Does nothing") | 155 | text: i18n("Does nothing") | ||
166 | onCheckedChanged: if (checked) cfg_currentDesktopSelected = 0; | 156 | onCheckedChanged: if (checked) cfg_currentDesktopSelected = 0; | ||
167 | } | 157 | } | ||
168 | Item { | | |||
169 | width: 2 | | |||
170 | height: 2 | | |||
171 | Layouts.Layout.rowSpan: 2 | | |||
172 | } | | |||
173 | QtControls.RadioButton { | 158 | QtControls.RadioButton { | ||
174 | id: showsDesktopRadio | 159 | id: showsDesktopRadio | ||
175 | exclusiveGroup: currentDesktopSelectedGroup | 160 | QtControls.ButtonGroup.group: currentDesktopSelectedGroup | ||
176 | text: i18n("Shows desktop") | 161 | text: i18n("Shows the desktop") | ||
177 | onCheckedChanged: if (checked) cfg_currentDesktopSelected = 1; | 162 | onCheckedChanged: if (checked) cfg_currentDesktopSelected = 1; | ||
178 | } | 163 | } | ||
179 | } | 164 | } | ||
180 | | ||||
181 | } | |
Default radio buttons should be at the top.