Changeset View
Standalone View
containments/desktop/package/contents/ui/FolderItemDelegate.qml
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 44 | function openPopup() { | |||
---|---|---|---|---|---|
47 | } | 47 | } | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | Loader { | 50 | Loader { | ||
51 | id: loader | 51 | id: loader | ||
52 | 52 | | |||
53 | anchors.fill: parent | 53 | anchors.fill: parent | ||
54 | 54 | | |||
55 | visible: status == Loader.Ready | ||||
broulik: `===` | |||||
hein: Will do. | |||||
56 | | ||||
55 | active: !model.blank | 57 | active: !model.blank | ||
56 | 58 | | |||
57 | sourceComponent: delegateImplementation | 59 | sourceComponent: delegateImplementation | ||
60 | | ||||
61 | asynchronous: true | ||||
I ran into quite some trouble (layouts, crashes, glitches) with async loaders in an item view, you said it didn't help anyways, so perhaps we can try without? broulik: I ran into quite some trouble (layouts, crashes, glitches) with async loaders in an item view… | |||||
Hmm well it's still kind of the right thing to do and probably helps a little bit. I'd say let's keep it until it actually causes problems? Note GridView has uniform delegate sizes (cell size is defined at the view level) so layout is much simpler in it than e.g. in ListView. hein: Hmm well it's still kind of the right thing to do and probably helps a little bit. I'd say… | |||||
58 | } | 62 | } | ||
59 | 63 | | |||
60 | Component { | 64 | Component { | ||
61 | id: delegateImplementation | 65 | id: delegateImplementation | ||
62 | 66 | | |||
63 | Item { | 67 | Item { | ||
64 | id: impl | 68 | id: impl | ||
65 | 69 | | |||
66 | anchors.fill: parent | 70 | anchors.fill: parent | ||
67 | 71 | | |||
68 | property bool blank: model.blank | 72 | property bool blank: model.blank | ||
69 | property bool selected: model.blank ? false : model.selected | 73 | property bool selected: model.blank ? false : model.selected | ||
70 | property bool isDir: model.blank ? false : model.isDir | 74 | property bool isDir: model.blank ? false : model.isDir | ||
71 | property bool hovered: (main.GridView.view.hoveredItem == main) | 75 | property bool hovered: (main.GridView.view.hoveredItem == main) | ||
72 | property QtObject popupDialog: null | 76 | property QtObject popupDialog: null | ||
73 | property Item iconArea: icon | 77 | property Item iconArea: icon | ||
74 | property Item label: label | 78 | property Item label: label | ||
75 | property Item labelArea: textShadow | 79 | property Item labelArea: frameLoader.textShadow ? frameLoader.textShadow : label | ||
broulik: Could be simplified to
frameLoader.textShadow || label | |||||
hein: Will do. | |||||
76 | property Item actionsOverlay: actions | 80 | property Item actionsOverlay: actions | ||
77 | property Item hoverArea: toolTip | 81 | property Item hoverArea: toolTip | ||
78 | property Item toolTip: toolTip | 82 | property Item toolTip: toolTip | ||
83 | property Item selectionButton: null | ||||
79 | property Item popupButton: null | 84 | property Item popupButton: null | ||
80 | 85 | | |||
81 | onSelectedChanged: { | 86 | onSelectedChanged: { | ||
82 | if (selected && !blank) { | 87 | if (selected && !blank) { | ||
83 | frame.grabToImage(function(result) { | 88 | frameLoader.grabToImage(function(result) { | ||
84 | dir.addItemDragImage(positioner.map(index), main.x + frame.x, main.y + frame.y, frame.width, frame.height, result.image); | 89 | dir.addItemDragImage(positioner.map(index), main.x + frameLoaderx, main.y + frameLoader.y, frameLoader.width, frameLoader.height, result.image); | ||
broulik: typo `frameLoader.x`
That's why the drag pixmap doesn't work | |||||
Good catch! Actually I noticed it was broken, but forgot I still needed to fix it - I was finishing this half-asleep on the weekend ;). hein: Good catch! Actually I noticed it was broken, but forgot I still needed to fix it - I was… | |||||
85 | }); | 90 | }); | ||
86 | } | 91 | } | ||
87 | } | 92 | } | ||
88 | 93 | | |||
89 | onIsDirChanged: { | 94 | onHoveredChanged: { | ||
90 | if (isDir && main.GridView.view.isRootView && impl.popupButton == null) { | 95 | if (hovered) { | ||
91 | impl.popupButton = popupButtonComponent.createObject(actions); | 96 | if (plasmoid.configuration.selectionMarkers && Qt.styleHints.singleClickActivation) { | ||
92 | } else if (impl.popupButton) { | 97 | selectionButton = selectionButtonComponent.createObject(actions); | ||
93 | impl.popupButton.destroy(); | | |||
94 | impl.popupButton = null; | | |||
95 | } | | |||
96 | } | 98 | } | ||
97 | 99 | | |||
98 | onHoveredChanged: { | 100 | if (model.isDir) { | ||
99 | if (hovered && (!main.GridView.view.isRootView || root.containsDrag) && model.isDir) { | 101 | if (!main.GridView.view.isRootView || root.containsDrag) { | ||
100 | hoverActivateTimer.restart(); | 102 | hoverActivateTimer.restart(); | ||
101 | } else if (!hovered) | 103 | } | ||
104 | | ||||
105 | if (plasmoid.configuration.popups && !root.useListViewMode) { | ||||
106 | popupButton = popupButtonComponent.createObject(actions); | ||||
107 | } | ||||
108 | } | ||||
109 | } else if (!hovered) { | ||||
102 | hoverActivateTimer.stop(); | 110 | hoverActivateTimer.stop(); | ||
103 | 111 | | |||
104 | if (popupDialog != null) { | 112 | if (popupDialog != null) { | ||
105 | popupDialog.requestDestroy(); | 113 | popupDialog.requestDestroy(); | ||
106 | popupDialog = null; | 114 | popupDialog = null; | ||
107 | } | 115 | } | ||
116 | | ||||
117 | if (selectionButton) { | ||||
118 | selectionButton.destroy(); | ||||
119 | selectionButton = null; | ||||
120 | } | ||||
QML nulls properties automatically if the item referenced is destroyed but I understand you want this explicitly broulik: QML nulls properties automatically if the item referenced is destroyed but I understand you… | |||||
121 | | ||||
122 | if (popupButton) { | ||||
123 | popupButton.destroy(); | ||||
124 | popupButton = null; | ||||
125 | } | ||||
126 | } | ||||
108 | } | 127 | } | ||
109 | 128 | | |||
110 | function openPopup() { | 129 | function openPopup() { | ||
111 | if (folderViewDialogComponent.status == Component.Ready) { | 130 | if (folderViewDialogComponent.status == Component.Ready) { | ||
112 | impl.popupDialog = folderViewDialogComponent.createObject(impl); | 131 | impl.popupDialog = folderViewDialogComponent.createObject(impl); | ||
113 | impl.popupDialog.visualParent = icon; | 132 | impl.popupDialog.visualParent = icon; | ||
114 | impl.popupDialog.url = model.linkDestinationUrl; | 133 | impl.popupDialog.url = model.linkDestinationUrl; | ||
115 | impl.popupDialog.visible = true; | 134 | impl.popupDialog.visible = true; | ||
116 | } | 135 | } | ||
117 | } | 136 | } | ||
118 | 137 | | |||
119 | Timer { | | |||
120 | id: hoverActivateTimer | | |||
121 | | ||||
122 | interval: root.hoverActivateDelay | | |||
123 | | ||||
124 | onTriggered: { | | |||
125 | if (root.useListViewMode) { | | |||
126 | doCd(index); | | |||
127 | } else { | | |||
128 | impl.openPopup(); | | |||
129 | } | | |||
130 | } | | |||
131 | } | | |||
132 | | ||||
133 | Connections { | | |||
134 | target: main.GridView.view | | |||
135 | | ||||
136 | enabled: hovered | | |||
137 | | ||||
138 | onContentXChanged: { | | |||
139 | hoverActivateTimer.stop(); | | |||
140 | } | | |||
141 | | ||||
142 | onContentYChanged: { | | |||
143 | hoverActivateTimer.stop(); | | |||
144 | } | | |||
145 | } | | |||
146 | | ||||
147 | PlasmaCore.ToolTipArea { | 138 | PlasmaCore.ToolTipArea { | ||
148 | id: toolTip | 139 | id: toolTip | ||
149 | 140 | | |||
150 | x: frame.x + Math.min(icon.x, label.x) | 141 | x: frameLoader.x + Math.min(icon.x, label.x) | ||
151 | y: frame.y + icon.y | 142 | y: frameLoader.y + icon.y | ||
152 | 143 | | |||
153 | width: Math.max(icon.width, label.width) | 144 | width: Math.max(icon.width, label.width) | ||
154 | height: (label.y + label.paintedHeight) | 145 | height: (label.y + label.paintedHeight) | ||
155 | 146 | | |||
156 | active: (plasmoid.configuration.toolTips && popupDialog == null && !model.blank) | 147 | active: (plasmoid.configuration.toolTips && popupDialog == null && !model.blank) | ||
157 | interactive: false | 148 | interactive: false | ||
158 | location: root.useListViewMode ? (plasmoid.location == PlasmaCore.Types.LeftEdge ? PlasmaCore.Types.LeftEdge : PlasmaCore.Types.RightEdge) : plasmoid.location | 149 | location: root.useListViewMode ? (plasmoid.location == PlasmaCore.Types.LeftEdge ? PlasmaCore.Types.LeftEdge : PlasmaCore.Types.RightEdge) : plasmoid.location | ||
159 | 150 | | |||
160 | onContainsMouseChanged: { | 151 | onContainsMouseChanged: { | ||
161 | if (containsMouse && !model.blank) { | 152 | if (containsMouse && !model.blank) { | ||
162 | toolTip.icon = model.decoration; | 153 | toolTip.icon = model.decoration; | ||
163 | toolTip.mainText = model.display; | 154 | toolTip.mainText = model.display; | ||
164 | 155 | | |||
165 | if (model.size != undefined) { | 156 | if (model.size != undefined) { | ||
166 | toolTip.subText = model.type + "\n" + model.size; | 157 | toolTip.subText = model.type + "\n" + model.size; | ||
167 | } else { | 158 | } else { | ||
168 | toolTip.subText = model.type; | 159 | toolTip.subText = model.type; | ||
169 | } | 160 | } | ||
170 | 161 | | |||
171 | main.GridView.view.hoveredItem = main; | 162 | main.GridView.view.hoveredItem = main; | ||
172 | } | 163 | } | ||
173 | } | 164 | } | ||
174 | } | 165 | } | ||
175 | 166 | | |||
176 | PlasmaCore.FrameSvgItem { | 167 | Loader { | ||
177 | id: frame | 168 | id: frameLoader | ||
178 | 169 | | |||
179 | x: root.useListViewMode ? 0 : units.smallSpacing | 170 | x: root.useListViewMode ? 0 : units.smallSpacing | ||
180 | y: root.useListViewMode ? 0 : units.smallSpacing | 171 | y: root.useListViewMode ? 0 : units.smallSpacing | ||
181 | 172 | | |||
173 | property Item textShadow: null | ||||
174 | property string prefix: "" | ||||
175 | | ||||
176 | sourceComponent: frameComponent | ||||
177 | active: state != "" | ||||
broulik: `!==` | |||||
hein: Will do. | |||||
178 | asynchronous: true | ||||
179 | | ||||
182 | width: { | 180 | width: { | ||
183 | if (root.useListViewMode) { | 181 | if (root.useListViewMode) { | ||
184 | if (main.GridView.view.overflowing) { | 182 | if (main.GridView.view.overflowing) { | ||
185 | return parent.width - units.smallSpacing; | 183 | return parent.width - units.smallSpacing; | ||
186 | } else { | 184 | } else { | ||
187 | return parent.width; | 185 | return parent.width; | ||
188 | } | 186 | } | ||
189 | } | 187 | } | ||
190 | 188 | | |||
191 | return parent.width - (units.smallSpacing * 2); | 189 | return parent.width - (units.smallSpacing * 2); | ||
192 | } | 190 | } | ||
193 | 191 | | |||
194 | height: { | 192 | height: { | ||
195 | if (root.useListViewMode) { | 193 | if (root.useListViewMode) { | ||
196 | return parent.height; | 194 | return parent.height; | ||
197 | } | 195 | } | ||
198 | 196 | | |||
199 | return (icon.height + (2 * units.smallSpacing) + (label.lineCount | 197 | return (icon.height + (2 * units.smallSpacing) + (label.lineCount | ||
200 | * theme.mSize(theme.defaultFont).height) + (2 * units.largeSpacing)); | 198 | * theme.mSize(theme.defaultFont).height) + (2 * units.largeSpacing)); | ||
201 | } | 199 | } | ||
202 | 200 | | |||
203 | visible: !model.blank | | |||
204 | enabled: visible | | |||
205 | | ||||
206 | imagePath: "widgets/viewitem" | | |||
207 | | ||||
208 | PlasmaCore.ColorScope { | | |||
209 | anchors.fill: parent | | |||
210 | | ||||
211 | colorGroup: ((root.isContainment && main.GridView.view.isRootView) ? PlasmaCore.Theme.ComplementaryColorGroup | | |||
212 | : PlasmaCore.Theme.NormalColorGroup) | | |||
213 | | ||||
214 | PlasmaCore.IconItem { | 201 | PlasmaCore.IconItem { | ||
215 | id: icon | 202 | id: icon | ||
216 | 203 | | |||
204 | z: 2 | ||||
205 | | ||||
217 | states: [ | 206 | states: [ | ||
218 | State { // icon view | 207 | State { // icon view | ||
219 | when: !root.useListViewMode | 208 | when: !root.useListViewMode | ||
220 | 209 | | |||
221 | AnchorChanges { | 210 | AnchorChanges { | ||
222 | target: icon | 211 | target: icon | ||
223 | anchors.top: parent.top | 212 | anchors.top: parent.top | ||
224 | anchors.horizontalCenter: parent.horizontalCenter | 213 | anchors.horizontalCenter: parent.horizontalCenter | ||
Show All 13 Lines | |||||
238 | anchors { | 227 | anchors { | ||
239 | topMargin: units.largeSpacing | 228 | topMargin: units.largeSpacing | ||
240 | leftMargin: units.smallSpacing | 229 | leftMargin: units.smallSpacing | ||
241 | } | 230 | } | ||
242 | 231 | | |||
243 | width: root.useListViewMode ? main.GridView.view.iconSize : (parent.width - 2 * units.smallSpacing) | 232 | width: root.useListViewMode ? main.GridView.view.iconSize : (parent.width - 2 * units.smallSpacing) | ||
244 | height: main.GridView.view.iconSize | 233 | height: main.GridView.view.iconSize | ||
245 | 234 | | |||
246 | opacity: root.useListViewMode ? (1.3 - selectionButton.opacity) : 1.0 | 235 | opacity: root.useListViewMode && selectionButton ? 0.3 : 1.0 | ||
247 | 236 | | |||
248 | animated: false | 237 | animated: false | ||
249 | usesPlasmaTheme: false | 238 | usesPlasmaTheme: false | ||
250 | 239 | | |||
251 | source: model.decoration | 240 | source: model.decoration | ||
252 | overlays: model.overlays | 241 | overlays: model.overlays | ||
253 | } | 242 | } | ||
254 | 243 | | |||
255 | TextMetrics { | | |||
256 | id: labelMetrics | | |||
257 | | ||||
258 | font: label.font | | |||
259 | elide: Text.ElideNone | | |||
260 | text: label.text | | |||
261 | } | | |||
262 | | ||||
263 | DropShadow { | | |||
264 | id: textShadow | | |||
265 | | ||||
266 | anchors.fill: label | | |||
267 | | ||||
268 | visible: (root.isContainment && main.GridView.view.isRootView) | | |||
269 | | ||||
270 | horizontalOffset: 2 | | |||
271 | verticalOffset: 2 | | |||
272 | | ||||
273 | radius: 9.0 | | |||
274 | samples: 18 | | |||
275 | spread: 0.15 | | |||
276 | | ||||
277 | color: "black" | | |||
278 | | ||||
279 | source: label | | |||
280 | } | | |||
281 | | ||||
282 | PlasmaComponents.Label { | 244 | PlasmaComponents.Label { | ||
283 | id: label | 245 | id: label | ||
284 | 246 | | |||
247 | z: 2 // So we can position a textShadowComponent below if needed. | ||||
248 | | ||||
285 | states: [ | 249 | states: [ | ||
286 | State { // icon view | 250 | State { // icon view | ||
287 | when: !root.useListViewMode | 251 | when: !root.useListViewMode | ||
288 | 252 | | |||
289 | AnchorChanges { | 253 | AnchorChanges { | ||
290 | target: label | 254 | target: label | ||
291 | anchors.top: icon.bottom | 255 | anchors.top: icon.bottom | ||
292 | anchors.horizontalCenter: parent.horizontalCenter | 256 | anchors.horizontalCenter: parent.horizontalCenter | ||
293 | } | 257 | } | ||
294 | PropertyChanges { | 258 | PropertyChanges { | ||
295 | target: label | 259 | target: label | ||
296 | anchors.topMargin: 2 * units.smallSpacing | 260 | anchors.topMargin: 2 * units.smallSpacing | ||
297 | width: Math.min(labelMetrics.advanceWidth + units.smallSpacing, parent.width - units.smallSpacing * 8) | 261 | width: Math.min(label.implicitWidth + units.smallSpacing, parent.width - units.smallSpacing * 8) | ||
298 | maximumLineCount: plasmoid.configuration.textLines | 262 | maximumLineCount: plasmoid.configuration.textLines | ||
299 | horizontalAlignment: Text.AlignHCenter | 263 | horizontalAlignment: Text.AlignHCenter | ||
300 | } | 264 | } | ||
301 | }, | 265 | }, | ||
302 | State { // list view | 266 | State { // list view | ||
303 | when: root.useListViewMode | 267 | when: root.useListViewMode | ||
304 | 268 | | |||
305 | AnchorChanges { | 269 | AnchorChanges { | ||
Show All 14 Lines | |||||
320 | 284 | | |||
321 | height: undefined // Unset PlasmaComponents.Label's default. | 285 | height: undefined // Unset PlasmaComponents.Label's default. | ||
322 | 286 | | |||
323 | textFormat: Text.PlainText | 287 | textFormat: Text.PlainText | ||
324 | 288 | | |||
325 | wrapMode: Text.Wrap | 289 | wrapMode: Text.Wrap | ||
326 | elide: Text.ElideRight | 290 | elide: Text.ElideRight | ||
327 | 291 | | |||
328 | color: textShadow.visible ? "white" : PlasmaCore.ColorScope.textColor | 292 | color: (frameLoader.textShadow && frameLoader.textShadow.visible | ||
Careful with binding things to visible, it updates recursively and may cause unexpected re-evaluations or glitches when the applet popup opens/closes (like the folderview title bug) broulik: Careful with binding things to `visible`, it updates recursively and may cause unexpected re… | |||||
There's no visible changes in the parent chain and it's a leaf node, so should be fine though? Changed the color string. hein: There's no visible changes in the parent chain and it's a leaf node, so should be fine though? | |||||
293 | ? "white" : PlasmaCore.ColorScope.textColor) | ||||
broulik: Since we're all about speed here, `"#fff"` is ~6% faster than `"white"` :D | |||||
329 | 294 | | |||
330 | text: model.blank ? "" : model.display | 295 | text: model.blank ? "" : model.display | ||
331 | 296 | | |||
332 | font.italic: model.isLink | 297 | font.italic: model.isLink | ||
333 | 298 | | |||
334 | Component.onCompleted: textFix.disableMouseHandling(label) // FIXME TODO: See https://codereview.qt-project.org/#/c/113758/ | 299 | Component.onCompleted: textFix.disableMouseHandling(label) // FIXME TODO: See https://codereview.qt-project.org/#/c/113758/ | ||
335 | } | 300 | } | ||
336 | } | | |||
337 | 301 | | |||
338 | Column { | 302 | Column { | ||
339 | id: actions | 303 | id: actions | ||
340 | 304 | | |||
341 | visible: { | 305 | visible: { | ||
342 | if (main.GridView.view.isRootView && root.containsDrag) { | 306 | if (main.GridView.view.isRootView && root.containsDrag) { | ||
343 | return false; | 307 | return false; | ||
344 | } | 308 | } | ||
345 | 309 | | |||
346 | if (!main.GridView.view.isRootView && dialog.containsDrag) { | 310 | if (!main.GridView.view.isRootView && dialog.containsDrag) { | ||
347 | return false; | 311 | return false; | ||
348 | } | 312 | } | ||
349 | 313 | | |||
350 | if (popupDialog) { | 314 | if (popupDialog) { | ||
351 | return false; | 315 | return false; | ||
352 | } | 316 | } | ||
353 | 317 | | |||
354 | return true; | 318 | return true; | ||
355 | } | 319 | } | ||
356 | 320 | | |||
357 | x: units.smallSpacing * 3 | 321 | x: units.smallSpacing * 3 | ||
358 | y: units.smallSpacing * 3 | 322 | y: units.smallSpacing * 3 | ||
359 | 323 | | |||
324 | z: 3 | ||||
325 | | ||||
360 | anchors { | 326 | anchors { | ||
361 | centerIn: root.useListViewMode ? icon : undefined | 327 | centerIn: root.useListViewMode ? icon : undefined | ||
362 | } | 328 | } | ||
363 | 329 | | |||
364 | width: implicitWidth | 330 | width: implicitWidth | ||
365 | height: implicitHeight | 331 | height: implicitHeight | ||
332 | } | ||||
366 | 333 | | |||
367 | FolderItemActionButton { | 334 | Component { | ||
368 | id: selectionButton | 335 | id: frameComponent | ||
336 | | ||||
337 | PlasmaCore.FrameSvgItem { | ||||
338 | prefix: frameLoader.prefix | ||||
339 | | ||||
340 | imagePath: "widgets/viewitem" | ||||
341 | } | ||||
342 | } | ||||
369 | 343 | | |||
370 | visible: plasmoid.configuration.selectionMarkers && Qt.styleHints.singleClickActivation | 344 | Component { | ||
371 | opacity: (visible && impl.hovered) ? 1.0 : 0.0 | 345 | id: selectionButtonComponent | ||
372 | 346 | | |||
347 | FolderItemActionButton { | ||||
373 | element: model.selected ? "remove" : "add" | 348 | element: model.selected ? "remove" : "add" | ||
374 | 349 | | |||
375 | onClicked: dir.toggleSelected(positioner.map(index)) | 350 | onClicked: dir.toggleSelected(positioner.map(index)) | ||
376 | } | 351 | } | ||
377 | } | 352 | } | ||
378 | 353 | | |||
379 | Component { | 354 | Component { | ||
380 | id: popupButtonComponent | 355 | id: popupButtonComponent | ||
381 | 356 | | |||
382 | FolderItemActionButton { | 357 | FolderItemActionButton { | ||
383 | visible: !root.useListViewMode | 358 | visible: popupDialog == null | ||
384 | | ||||
385 | opacity: (plasmoid.configuration.popups && impl.hovered && impl.popupDialog == null) ? 1.0 : 0.0 | | |||
386 | 359 | | |||
387 | element: "open" | 360 | element: "open" | ||
388 | 361 | | |||
389 | onClicked: impl.openPopup() | 362 | onClicked: openPopup() | ||
363 | } | ||||
364 | } | ||||
365 | | ||||
366 | Component { | ||||
367 | id: textShadowComponent | ||||
368 | | ||||
369 | DropShadow { | ||||
370 | anchors.fill: label | ||||
371 | | ||||
372 | z: 1 | ||||
373 | | ||||
374 | horizontalOffset: 2 | ||||
375 | verticalOffset: 2 | ||||
376 | | ||||
377 | radius: 9.0 | ||||
378 | samples: 18 | ||||
379 | spread: 0.15 | ||||
380 | | ||||
381 | color: "black" | ||||
382 | | ||||
383 | source: label | ||||
390 | } | 384 | } | ||
391 | } | 385 | } | ||
392 | 386 | | |||
393 | states: [ | 387 | states: [ | ||
394 | State { | 388 | State { | ||
395 | name: "selected" | 389 | name: "selected" | ||
396 | when: model.selected | 390 | when: model.selected | ||
397 | 391 | | |||
398 | PropertyChanges { | 392 | PropertyChanges { | ||
399 | target: frame | 393 | target: frameLoader | ||
400 | prefix: "selected" | 394 | prefix: "selected" | ||
401 | } | 395 | } | ||
402 | }, | 396 | }, | ||
403 | State { | 397 | State { | ||
404 | name: "hover" | 398 | name: "hover" | ||
405 | when: hovered && !model.selected | 399 | when: hovered && !model.selected | ||
406 | 400 | | |||
407 | PropertyChanges { | 401 | PropertyChanges { | ||
408 | target: frame | 402 | target: frameLoader | ||
409 | prefix: "hover" | 403 | prefix: "hover" | ||
410 | } | 404 | } | ||
411 | }, | 405 | }, | ||
412 | State { | 406 | State { | ||
413 | name: "selected+hover" | 407 | name: "selected+hover" | ||
414 | when: hovered && model.selected | 408 | when: hovered && model.selected | ||
415 | 409 | | |||
416 | PropertyChanges { | 410 | PropertyChanges { | ||
417 | target: frame | 411 | target: frameLoader | ||
418 | prefix: "selected+hover" | 412 | prefix: "selected+hover" | ||
419 | } | 413 | } | ||
420 | } | 414 | } | ||
421 | ] | 415 | ] | ||
422 | } | 416 | } | ||
417 | | ||||
418 | Component.onCompleted: { | ||||
419 | if (root.isContainment && main.GridView.view.isRootView) { | ||||
420 | frameLoader.textShadow = textShadowComponent.createObject(frameLoader); | ||||
421 | } | ||||
422 | } | ||||
423 | } | 423 | } | ||
424 | } | 424 | } | ||
425 | } | 425 | } |
===