Changeset View
Changeset View
Standalone View
Standalone View
lib/qml/ResultDelegate.qml
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | 103 | onReleased: { | |||
---|---|---|---|---|---|
108 | 108 | | |||
109 | __pressed = false; | 109 | __pressed = false; | ||
110 | __pressX = -1; | 110 | __pressX = -1; | ||
111 | __pressY = -1; | 111 | __pressY = -1; | ||
112 | } | 112 | } | ||
113 | 113 | | |||
114 | onPositionChanged: { | 114 | onPositionChanged: { | ||
115 | if (__pressX != -1 && typeof dragHelper !== "undefined" && dragHelper.isDrag(__pressX, __pressY, mouse.x, mouse.y)) { | 115 | if (__pressX != -1 && typeof dragHelper !== "undefined" && dragHelper.isDrag(__pressX, __pressY, mouse.x, mouse.y)) { | ||
116 | var mimeData = ListView.view.model.getMimeData(index); | 116 | var resultsModel = ListView.view.model; | ||
117 | var mimeData = resultsModel.getMimeData(resultsModel.index(index, 0)); | ||||
117 | if (mimeData) { | 118 | if (mimeData) { | ||
118 | dragHelper.startDrag(root, mimeData, model.decoration); | 119 | dragHelper.startDrag(resultDelegate, mimeData, model.decoration); | ||
119 | __pressed = false; | 120 | __pressed = false; | ||
120 | __pressX = -1; | 121 | __pressX = -1; | ||
121 | __pressY = -1; | 122 | __pressY = -1; | ||
122 | } | 123 | } | ||
123 | } | 124 | } | ||
124 | 125 | | |||
125 | if (!listView.moved && listView.mouseMovedGlobally()) { | 126 | if (!listView.moved && listView.mouseMovedGlobally()) { | ||
126 | listView.moved = true | 127 | listView.moved = true | ||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 202 | PlasmaComponents.Label { | |||
210 | verticalAlignment: Text.AlignVCenter | 211 | verticalAlignment: Text.AlignVCenter | ||
211 | textFormat: Text.PlainText | 212 | textFormat: Text.PlainText | ||
212 | 213 | | |||
213 | Layout.maximumWidth: labelWrapper.width - typePixmap.width - actionsRow.width | 214 | Layout.maximumWidth: labelWrapper.width - typePixmap.width - actionsRow.width | ||
214 | } | 215 | } | ||
215 | 216 | | |||
216 | PlasmaComponents.Label { | 217 | PlasmaComponents.Label { | ||
217 | id: subtextLabel | 218 | id: subtextLabel | ||
218 | text: model.isDuplicate > 1 || resultDelegate.isCurrent ? String(model.subtext || "") : "" | 219 | | ||
220 | // SourcesModel returns number of duplicates in this property | ||||
221 | // ResultsModel just has it as a boolean as you would expect from the name of the property | ||||
222 | text: model.isDuplicate === true || model.isDuplicate > 1 || resultDelegate.isCurrent ? String(model.subtext || "") : "" | ||||
219 | 223 | | |||
220 | color: theme.textColor | 224 | color: theme.textColor | ||
221 | // HACK If displayLabel is too long it will shift this label outside boundaries | 225 | // HACK If displayLabel is too long it will shift this label outside boundaries | ||
222 | // but still render the text leading to it overlapping the action buttons looking horrible | 226 | // but still render the text leading to it overlapping the action buttons looking horrible | ||
223 | opacity: width > 0 ? 0.3 : 0 | 227 | opacity: width > 0 ? 0.3 : 0 | ||
224 | 228 | | |||
225 | height: undefined | 229 | height: undefined | ||
226 | 230 | | |||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |