Changeset View
Changeset View
Standalone View
Standalone View
applets/appmenu/package/contents/ui/main.qml
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Line(s) | 139 | onClicked: { | |||
---|---|---|---|---|---|
142 | checked = Qt.binding(function() { | 142 | checked = Qt.binding(function() { | ||
143 | return plasmoid.nativeInterface.currentIndex === index; | 143 | return plasmoid.nativeInterface.currentIndex === index; | ||
144 | }); | 144 | }); | ||
145 | } | 145 | } | ||
146 | 146 | | |||
147 | // QMenu opens on press, so we'll replicate that here | 147 | // QMenu opens on press, so we'll replicate that here | ||
148 | MouseArea { | 148 | MouseArea { | ||
149 | anchors.fill: parent | 149 | anchors.fill: parent | ||
150 | hoverEnabled: plasmoid.nativeInterface.currentIndex !== -1 | ||||
150 | onPressed: parent.clicked() | 151 | onPressed: parent.clicked() | ||
152 | onEntered: parent.clicked() | ||||
151 | } | 153 | } | ||
152 | } | 154 | } | ||
153 | } | 155 | } | ||
154 | } | 156 | } | ||
155 | 157 | | |||
156 | AppMenuPrivate.AppMenuModel { | 158 | AppMenuPrivate.AppMenuModel { | ||
157 | id: appMenuModel | 159 | id: appMenuModel | ||
158 | screenGeometry: plasmoid.screenGeometry | 160 | screenGeometry: plasmoid.screenGeometry | ||
159 | onRequestActivateIndex: plasmoid.nativeInterface.requestActivateIndex(index) | 161 | onRequestActivateIndex: plasmoid.nativeInterface.requestActivateIndex(index) | ||
160 | Component.onCompleted: { | 162 | Component.onCompleted: { | ||
161 | plasmoid.nativeInterface.model = appMenuModel | 163 | plasmoid.nativeInterface.model = appMenuModel | ||
162 | } | 164 | } | ||
163 | } | 165 | } | ||
164 | } | 166 | } |