Changeset View
Changeset View
Standalone View
Standalone View
applets/appmenu/package/contents/ui/main.qml
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | 108 | text: { | |||
---|---|---|---|---|---|
119 | return text; | 119 | return text; | ||
120 | } | 120 | } | ||
121 | // fake highlighted | 121 | // fake highlighted | ||
122 | checkable: plasmoid.nativeInterface.currentIndex === index | 122 | checkable: plasmoid.nativeInterface.currentIndex === index | ||
123 | checked: checkable | 123 | checked: checkable | ||
124 | visible: text !== "" | 124 | visible: text !== "" | ||
125 | onClicked: { | 125 | onClicked: { | ||
126 | plasmoid.nativeInterface.trigger(this, index) | 126 | plasmoid.nativeInterface.trigger(this, index) | ||
127 | | ||||
128 | checked = Qt.binding(function() { | ||||
129 | return plasmoid.nativeInterface.currentIndex === index; | ||||
130 | }); | ||||
127 | } | 131 | } | ||
128 | } | 132 | } | ||
129 | } | 133 | } | ||
130 | } | 134 | } | ||
131 | 135 | | |||
132 | AppMenuPrivate.AppMenuModel { | 136 | AppMenuPrivate.AppMenuModel { | ||
133 | id: appMenuModel | 137 | id: appMenuModel | ||
134 | onRequestActivateIndex: plasmoid.nativeInterface.requestActivateIndex(index) | 138 | onRequestActivateIndex: plasmoid.nativeInterface.requestActivateIndex(index) | ||
135 | Component.onCompleted: { | 139 | Component.onCompleted: { | ||
136 | plasmoid.nativeInterface.model = appMenuModel | 140 | plasmoid.nativeInterface.model = appMenuModel | ||
137 | } | 141 | } | ||
138 | } | 142 | } | ||
139 | } | 143 | } |