Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/ConfigEntries.qml
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 60 | QQC2.ScrollView { | |||
---|---|---|---|---|---|
70 | property var scrollBarWidth: scrollBarVisible ? QQC2.ScrollBar.vertical.width : 0 | 70 | property var scrollBarWidth: scrollBarVisible ? QQC2.ScrollBar.vertical.width : 0 | ||
71 | 71 | | |||
72 | ListView { | 72 | ListView { | ||
73 | id: itemsList | 73 | id: itemsList | ||
74 | 74 | | |||
75 | property var visibilityColumnWidth: units.gridUnit | 75 | property var visibilityColumnWidth: units.gridUnit | ||
76 | property var keySequenceColumnWidth: units.gridUnit | 76 | property var keySequenceColumnWidth: units.gridUnit | ||
77 | 77 | | |||
78 | model: PlasmaCore.SortFilterModel { | 78 | model: plasmoid.nativeInterface.configSystemTrayModel | ||
79 | sourceModel: PlasmaCore.SortFilterModel { | | |||
80 | sourceModel: plasmoid.nativeInterface.systemTrayModel | | |||
81 | | ||||
82 | sortRole: "display" | | |||
83 | sortColumn: 0 | | |||
84 | isSortLocaleAware: true | | |||
85 | } | | |||
86 | | ||||
87 | sortRole: "category" | | |||
88 | sortColumn: 0 | | |||
89 | isSortLocaleAware: true | | |||
90 | } | | |||
91 | 79 | | |||
92 | header: Kirigami.AbstractListItem { | 80 | header: Kirigami.AbstractListItem { | ||
93 | 81 | | |||
94 | hoverEnabled: false | 82 | hoverEnabled: false | ||
95 | 83 | | |||
96 | RowLayout { | 84 | RowLayout { | ||
97 | Kirigami.Heading { | 85 | Kirigami.Heading { | ||
98 | text: i18nc("Name of the system tray entry", "Entry") | 86 | text: i18nc("Name of the system tray entry", "Entry") | ||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 161 | for (var i = 0; i < model.length; i++) { | |||
174 | if (model[i].value === value) { | 162 | if (model[i].value === value) { | ||
175 | return i | 163 | return i | ||
176 | } | 164 | } | ||
177 | } | 165 | } | ||
178 | 166 | | |||
179 | return 0 | 167 | return 0 | ||
180 | } | 168 | } | ||
181 | 169 | | |||
182 | property var currentValue: model[currentIndex].value | 170 | property var myCurrentValue: model[currentIndex].value | ||
183 | 171 | | |||
184 | onActivated: { | 172 | onActivated: { | ||
185 | var shownIndex = cfg_shownItems.indexOf(itemId) | 173 | var shownIndex = cfg_shownItems.indexOf(itemId) | ||
186 | var hiddenIndex = cfg_hiddenItems.indexOf(itemId) | 174 | var hiddenIndex = cfg_hiddenItems.indexOf(itemId) | ||
187 | var extraIndex = cfg_extraItems.indexOf(itemId) | 175 | var extraIndex = cfg_extraItems.indexOf(itemId) | ||
188 | 176 | | |||
189 | switch (currentValue) { | 177 | switch (myCurrentValue) { | ||
190 | case "auto": | 178 | case "auto": | ||
191 | if (shownIndex > -1) { | 179 | if (shownIndex > -1) { | ||
192 | cfg_shownItems.splice(shownIndex, 1) | 180 | cfg_shownItems.splice(shownIndex, 1) | ||
193 | } | 181 | } | ||
194 | if (hiddenIndex > -1) { | 182 | if (hiddenIndex > -1) { | ||
195 | cfg_hiddenItems.splice(hiddenIndex, 1) | 183 | cfg_hiddenItems.splice(hiddenIndex, 1) | ||
196 | } | 184 | } | ||
197 | if (extraIndex === -1) { | 185 | if (extraIndex === -1) { | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | |||||
252 | } | 240 | } | ||
253 | KQC.KeySequenceItem { | 241 | KQC.KeySequenceItem { | ||
254 | id: keySequenceItem | 242 | id: keySequenceItem | ||
255 | Layout.minimumWidth: itemsList.keySequenceColumnWidth | 243 | Layout.minimumWidth: itemsList.keySequenceColumnWidth | ||
256 | Layout.preferredWidth: itemsList.keySequenceColumnWidth | 244 | Layout.preferredWidth: itemsList.keySequenceColumnWidth | ||
257 | Component.onCompleted: itemsList.keySequenceColumnWidth = Math.max(implicitWidth, itemsList.keySequenceColumnWidth) | 245 | Component.onCompleted: itemsList.keySequenceColumnWidth = Math.max(implicitWidth, itemsList.keySequenceColumnWidth) | ||
258 | 246 | | |||
259 | visible: isPlasmoid | 247 | visible: isPlasmoid | ||
260 | enabled: visibilityComboBox.currentValue !== "disabled" | 248 | enabled: visibilityComboBox.myCurrentValue !== "disabled" | ||
261 | keySequence: model.applet ? model.applet.globalShortcut : "" | 249 | keySequence: model.applet ? model.applet.globalShortcut : "" | ||
262 | onKeySequenceChanged: { | 250 | onKeySequenceChanged: { | ||
263 | if (model.applet && keySequence !== model.applet.globalShortcut) { | 251 | if (model.applet && keySequence !== model.applet.globalShortcut) { | ||
264 | model.applet.globalShortcut = keySequence | 252 | model.applet.globalShortcut = keySequence | ||
265 | 253 | | |||
266 | itemsList.keySequenceColumnWidth = Math.max(implicitWidth, itemsList.keySequenceColumnWidth) | 254 | itemsList.keySequenceColumnWidth = Math.max(implicitWidth, itemsList.keySequenceColumnWidth) | ||
267 | } | 255 | } | ||
268 | } | 256 | } | ||
Show All 12 Lines |