Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/ConfigGeneral.qml
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 83 | Item { | |||
---|---|---|---|---|---|
84 | Kirigami.FormData.isSection: true | 84 | Kirigami.FormData.isSection: true | ||
85 | Kirigami.FormData.label: i18n("Extra Items") | 85 | Kirigami.FormData.label: i18n("Extra Items") | ||
86 | } | 86 | } | ||
87 | 87 | | |||
88 | Repeater { | 88 | Repeater { | ||
89 | model: plasmoid.nativeInterface.availablePlasmoids | 89 | model: plasmoid.nativeInterface.availablePlasmoids | ||
90 | delegate: QtControls.CheckBox { | 90 | delegate: QtControls.CheckBox { | ||
91 | QtLayouts.Layout.minimumWidth: childrenRect.width | 91 | QtLayouts.Layout.minimumWidth: childrenRect.width | ||
92 | checked: cfg_extraItems.indexOf(plugin) != -1 | 92 | checked: cfg_extraItems.indexOf(itemId) != -1 | ||
93 | implicitWidth: itemLayout.width + itemLayout.x | 93 | implicitWidth: itemLayout.width + itemLayout.x | ||
94 | onCheckedChanged: { | 94 | onCheckedChanged: { | ||
95 | var index = cfg_extraItems.indexOf(plugin); | 95 | var index = cfg_extraItems.indexOf(itemId); | ||
96 | if (checked) { | 96 | if (checked) { | ||
97 | if (index === -1) { | 97 | if (index === -1) { | ||
98 | cfg_extraItems.push(plugin); | 98 | cfg_extraItems.push(itemId); | ||
99 | } | 99 | } | ||
100 | } else { | 100 | } else { | ||
101 | if (index > -1) { | 101 | if (index > -1) { | ||
102 | cfg_extraItems.splice(index, 1); | 102 | cfg_extraItems.splice(index, 1); | ||
103 | } | 103 | } | ||
104 | } | 104 | } | ||
105 | configurationChanged() // qml cannot detect changes inside an Array | 105 | configurationChanged() // qml cannot detect changes inside an Array | ||
106 | } | 106 | } | ||
Show All 17 Lines |