Changeset View
Changeset View
Standalone View
Standalone View
lib/qml/ResultDelegate.qml
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 75 | function activateLastAction() { | |||
---|---|---|---|---|---|
76 | activeAction = actionsRepeater.count - 1 | 76 | activeAction = actionsRepeater.count - 1 | ||
77 | } | 77 | } | ||
78 | 78 | | |||
79 | width: listItem.implicitWidth | 79 | width: listItem.implicitWidth | ||
80 | height: listItem.implicitHeight | 80 | height: listItem.implicitHeight | ||
81 | 81 | | |||
82 | acceptedButtons: Qt.LeftButton | 82 | acceptedButtons: Qt.LeftButton | ||
83 | hoverEnabled: true | 83 | hoverEnabled: true | ||
84 | onEntered: { | | |||
85 | listView.currentIndex = index | | |||
86 | } | | |||
87 | | ||||
88 | onPressed: { | 84 | onPressed: { | ||
89 | __pressed = true; | 85 | __pressed = true; | ||
90 | __pressX = mouse.x; | 86 | __pressX = mouse.x; | ||
91 | __pressY = mouse.y; | 87 | __pressY = mouse.y; | ||
92 | } | 88 | } | ||
93 | 89 | | |||
94 | onReleased: { | 90 | onReleased: { | ||
95 | if (__pressed) { | 91 | if (__pressed) { | ||
Show All 11 Lines | 102 | if (__pressX != -1 && typeof dragHelper !== "undefined" && dragHelper.isDrag(__pressX, __pressY, mouse.x, mouse.y)) { | |||
107 | var mimeData = ListView.view.model.getMimeData(index); | 103 | var mimeData = ListView.view.model.getMimeData(index); | ||
108 | if (mimeData) { | 104 | if (mimeData) { | ||
109 | dragHelper.startDrag(root, mimeData, model.decoration); | 105 | dragHelper.startDrag(root, mimeData, model.decoration); | ||
110 | __pressed = false; | 106 | __pressed = false; | ||
111 | __pressX = -1; | 107 | __pressX = -1; | ||
112 | __pressY = -1; | 108 | __pressY = -1; | ||
113 | } | 109 | } | ||
114 | } | 110 | } | ||
111 | | ||||
112 | if (!listView.moved && listView.mouseMovedGlobally()) { | ||||
113 | listView.moved = true | ||||
114 | listView.currentIndex = index | ||||
115 | } | ||||
115 | } | 116 | } | ||
116 | 117 | | |||
117 | onContainsMouseChanged: { | 118 | onContainsMouseChanged: { | ||
118 | if (!containsMouse) { | 119 | if (!containsMouse) { | ||
119 | __pressed = false; | 120 | __pressed = false; | ||
120 | __pressX = -1; | 121 | __pressX = -1; | ||
121 | __pressY = -1; | 122 | __pressY = -1; | ||
123 | } else { | ||||
124 | if (listView.moved) { | ||||
125 | listView.currentIndex = index | ||||
126 | } else if (listView.mouseMovedGlobally()) { | ||||
127 | listView.moved = true | ||||
128 | listView.currentIndex = index | ||||
129 | } | ||||
122 | } | 130 | } | ||
123 | } | 131 | } | ||
124 | 132 | | |||
125 | PlasmaComponents.Label { | 133 | PlasmaComponents.Label { | ||
126 | id: typeText | 134 | id: typeText | ||
127 | text: resultDelegate.typeText | 135 | text: resultDelegate.typeText | ||
128 | color: theme.textColor | 136 | color: theme.textColor | ||
129 | opacity: 0.5 | 137 | opacity: 0.5 | ||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |