Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/DraggableFileArea.qml
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 22 | MouseArea { | |||
---|---|---|---|---|---|
46 | onPressed: { | 46 | onPressed: { | ||
47 | if (mouse.button === Qt.LeftButton) { | 47 | if (mouse.button === Qt.LeftButton) { | ||
48 | _pressX = mouse.x; | 48 | _pressX = mouse.x; | ||
49 | _pressY = mouse.y; | 49 | _pressY = mouse.y; | ||
50 | } else if (mouse.button === Qt.RightButton) { | 50 | } else if (mouse.button === Qt.RightButton) { | ||
51 | area.contextMenuRequested(mouse.x, mouse.y); | 51 | area.contextMenuRequested(mouse.x, mouse.y); | ||
52 | } | 52 | } | ||
53 | } | 53 | } | ||
54 | onPositionChanged: { | 54 | function onPositionChanged() { | ||
55 | if (_pressX !== -1 && _pressY !== -1 && plasmoid.nativeInterface.isDrag(_pressX, _pressY, mouse.x, mouse.y)) { | 55 | if (_pressX !== -1 && _pressY !== -1 && plasmoid.nativeInterface.isDrag(_pressX, _pressY, mouse.x, mouse.y)) { | ||
56 | plasmoid.nativeInterface.startDrag(area.dragParent, area.dragUrl, area.dragPixmap); | 56 | plasmoid.nativeInterface.startDrag(area.dragParent, area.dragUrl, area.dragPixmap); | ||
57 | _pressX = -1; | 57 | _pressX = -1; | ||
58 | _pressY = -1; | 58 | _pressY = -1; | ||
59 | } | 59 | } | ||
60 | } | 60 | } | ||
61 | onReleased: { | 61 | onReleased: { | ||
62 | _pressX = -1; | 62 | _pressX = -1; | ||
63 | _pressY = -1; | 63 | _pressY = -1; | ||
64 | } | 64 | } | ||
65 | onContainsMouseChanged: { | 65 | function onContainsMouseChanged() { | ||
66 | if (!containsMouse) { | 66 | if (!containsMouse) { | ||
67 | _pressX = -1; | 67 | _pressX = -1; | ||
68 | _pressY = -1; | 68 | _pressY = -1; | ||
69 | } | 69 | } | ||
70 | } | 70 | } | ||
71 | } | 71 | } |