Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/FolderItemDelegate.qml
Show All 35 Lines | 29 | Item { | |||
---|---|---|---|---|---|
36 | property QtObject popupDialog: loader.item ? loader.item.popupDialog : null | 36 | property QtObject popupDialog: loader.item ? loader.item.popupDialog : null | ||
37 | property Item iconArea: loader.item ? loader.item.iconArea : null | 37 | property Item iconArea: loader.item ? loader.item.iconArea : null | ||
38 | property Item label: loader.item ? loader.item.label : null | 38 | property Item label: loader.item ? loader.item.label : null | ||
39 | property Item labelArea: loader.item ? loader.item.labelArea : null | 39 | property Item labelArea: loader.item ? loader.item.labelArea : null | ||
40 | property Item actionsOverlay: loader.item ? loader.item.actionsOverlay : null | 40 | property Item actionsOverlay: loader.item ? loader.item.actionsOverlay : null | ||
41 | property Item hoverArea: loader.item ? loader.item.hoverArea : null | 41 | property Item hoverArea: loader.item ? loader.item.hoverArea : null | ||
42 | property Item toolTip: loader.item ? loader.item.toolTip : null | 42 | property Item toolTip: loader.item ? loader.item.toolTip : null | ||
43 | 43 | | |||
44 | function openPopup() { | ||||
45 | if (isDir) { | ||||
46 | loader.item.openPopup(); | ||||
47 | } | ||||
48 | } | ||||
49 | | ||||
44 | Loader { | 50 | Loader { | ||
45 | id: loader | 51 | id: loader | ||
46 | 52 | | |||
47 | anchors.fill: parent | 53 | anchors.fill: parent | ||
48 | 54 | | |||
49 | active: !model.blank | 55 | active: !model.blank | ||
50 | 56 | | |||
51 | sourceComponent: delegateImplementation | 57 | sourceComponent: delegateImplementation | ||
Show All 33 Lines | 90 | if (isDir && main.GridView.view.isRootView && impl.popupButton == null) { | |||
85 | impl.popupButton = popupButtonComponent.createObject(actions); | 91 | impl.popupButton = popupButtonComponent.createObject(actions); | ||
86 | } else if (impl.popupButton) { | 92 | } else if (impl.popupButton) { | ||
87 | impl.popupButton.destroy(); | 93 | impl.popupButton.destroy(); | ||
88 | impl.popupButton = null; | 94 | impl.popupButton = null; | ||
89 | } | 95 | } | ||
90 | } | 96 | } | ||
91 | 97 | | |||
92 | onHoveredChanged: { | 98 | onHoveredChanged: { | ||
93 | if (hovered && !main.GridView.view.isRootView && model.isDir) { | 99 | if (hovered && (!main.GridView.view.isRootView || root.containsDrag) && model.isDir) { | ||
94 | openPopupTimer.start(); | 100 | hoverActivateTimer.restart(); | ||
95 | } else if (!hovered) | 101 | } else if (!hovered) | ||
96 | openPopupTimer.stop(); | 102 | hoverActivateTimer.stop(); | ||
97 | 103 | | |||
98 | if (popupDialog != null) { | 104 | if (popupDialog != null) { | ||
99 | popupDialog.destroy(); | 105 | popupDialog.requestDestroy(); | ||
100 | popupDialog = null; | 106 | popupDialog = null; | ||
101 | } | 107 | } | ||
102 | } | 108 | } | ||
103 | 109 | | |||
104 | function openPopup() { | 110 | function openPopup() { | ||
105 | if (folderViewDialogComponent.status == Component.Ready) { | 111 | if (folderViewDialogComponent.status == Component.Ready) { | ||
106 | impl.popupDialog = folderViewDialogComponent.createObject(impl); | 112 | impl.popupDialog = folderViewDialogComponent.createObject(impl); | ||
107 | impl.popupDialog.visualParent = icon; | 113 | impl.popupDialog.visualParent = icon; | ||
108 | impl.popupDialog.url = model.linkDestinationUrl; | 114 | impl.popupDialog.url = model.linkDestinationUrl; | ||
109 | impl.popupDialog.visible = true; | 115 | impl.popupDialog.visible = true; | ||
110 | } | 116 | } | ||
111 | } | 117 | } | ||
112 | 118 | | |||
113 | Timer { | 119 | Timer { | ||
114 | id: openPopupTimer | 120 | id: hoverActivateTimer | ||
115 | 121 | | |||
116 | interval: units.longDuration * 3 | 122 | interval: root.hoverActivateDelay | ||
117 | 123 | | |||
118 | onTriggered: { | 124 | onTriggered: { | ||
125 | if (root.useListViewMode) { | ||||
126 | doCd(index); | ||||
127 | } else { | ||||
119 | impl.openPopup(); | 128 | impl.openPopup(); | ||
120 | } | 129 | } | ||
121 | } | 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 | } | ||||
122 | 146 | | |||
123 | PlasmaCore.ToolTipArea { | 147 | PlasmaCore.ToolTipArea { | ||
124 | id: toolTip | 148 | id: toolTip | ||
125 | 149 | | |||
126 | x: frame.x + Math.min(icon.x, label.x) | 150 | x: frame.x + Math.min(icon.x, label.x) | ||
127 | y: frame.y + icon.y | 151 | y: frame.y + icon.y | ||
128 | 152 | | |||
129 | width: Math.max(icon.width, label.width) | 153 | width: Math.max(icon.width, label.width) | ||
▲ Show 20 Lines • Show All 179 Lines • ▼ Show 20 Line(s) | 282 | PlasmaComponents.Label { | |||
309 | 333 | | |||
310 | Component.onCompleted: textFix.disableMouseHandling(label) // FIXME TODO: See https://codereview.qt-project.org/#/c/113758/ | 334 | Component.onCompleted: textFix.disableMouseHandling(label) // FIXME TODO: See https://codereview.qt-project.org/#/c/113758/ | ||
311 | } | 335 | } | ||
312 | } | 336 | } | ||
313 | 337 | | |||
314 | Column { | 338 | Column { | ||
315 | id: actions | 339 | id: actions | ||
316 | 340 | | |||
341 | visible: { | ||||
342 | if (main.GridView.view.isRootView && root.containsDrag) { | ||||
343 | return false; | ||||
344 | } | ||||
345 | | ||||
346 | if (!main.GridView.view.isRootView && dialog.containsDrag) { | ||||
347 | return false; | ||||
348 | } | ||||
349 | | ||||
350 | if (popupDialog) { | ||||
351 | return false; | ||||
352 | } | ||||
353 | | ||||
354 | return true; | ||||
355 | } | ||||
356 | | ||||
317 | x: units.smallSpacing * 3 | 357 | x: units.smallSpacing * 3 | ||
318 | y: units.smallSpacing * 3 | 358 | y: units.smallSpacing * 3 | ||
319 | 359 | | |||
320 | anchors { | 360 | anchors { | ||
321 | centerIn: root.useListViewMode ? icon : undefined | 361 | centerIn: root.useListViewMode ? icon : undefined | ||
322 | } | 362 | } | ||
323 | 363 | | |||
324 | width: implicitWidth | 364 | width: implicitWidth | ||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |