Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/MouseHandler.qml
Show All 28 Lines | |||||
29 | Item { | 29 | Item { | ||
30 | signal urlsDropped(var urls) | 30 | signal urlsDropped(var urls) | ||
31 | 31 | | |||
32 | property Item target | 32 | property Item target | ||
33 | property Item ignoredItem | 33 | property Item ignoredItem | ||
34 | property bool moved: false | 34 | property bool moved: false | ||
35 | 35 | | |||
36 | property alias hoveredItem: dropHandler.hoveredItem | 36 | property alias hoveredItem: dropHandler.hoveredItem | ||
37 | property alias handleWheelEvents: wheelHandler.active | ||||
37 | 38 | | |||
38 | Timer { | 39 | Timer { | ||
39 | id: ignoreItemTimer | 40 | id: ignoreItemTimer | ||
40 | 41 | | |||
41 | repeat: false | 42 | repeat: false | ||
42 | interval: 750 | 43 | interval: 750 | ||
43 | 44 | | |||
44 | onTriggered: { | 45 | onTriggered: { | ||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 128 | Timer { | |||
140 | } | 141 | } | ||
141 | } | 142 | } | ||
142 | } | 143 | } | ||
143 | 144 | | |||
144 | MouseArea { | 145 | MouseArea { | ||
145 | id: wheelHandler | 146 | id: wheelHandler | ||
146 | 147 | | |||
147 | anchors.fill: parent | 148 | anchors.fill: parent | ||
149 | | ||||
150 | enabled: active && plasmoid.configuration.wheelEnabled | ||||
151 | | ||||
152 | property bool active: true | ||||
148 | property int wheelDelta: 0; | 153 | property int wheelDelta: 0; | ||
149 | enabled: plasmoid.configuration.wheelEnabled | | |||
150 | 154 | | |||
151 | onWheel: wheelDelta = TaskTools.wheelActivateNextPrevTask(null, wheelDelta, wheel.angleDelta.y); | 155 | onWheel: { | ||
156 | if (!active) { | ||||
157 | wheel.accepted = false; | ||||
158 | return; | ||||
159 | } | ||||
160 | | ||||
161 | wheelDelta = TaskTools.wheelActivateNextPrevTask(null, wheelDelta, wheel.angleDelta.y); | ||||
162 | } | ||||
152 | } | 163 | } | ||
153 | } | 164 | } |