Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/FolderViewLayer.qml
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 49 | for (var i = 0; i < sharedActions.length; i++) { | |||
---|---|---|---|---|---|
56 | appletAction.visible = modelAction.visible; | 56 | appletAction.visible = modelAction.visible; | ||
57 | } | 57 | } | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | function cancelRename() { | 60 | function cancelRename() { | ||
61 | folderView.cancelRename(); | 61 | folderView.cancelRename(); | ||
62 | } | 62 | } | ||
63 | 63 | | |||
64 | function goHome() { | ||||
65 | if (folderView.url != plasmoid.configuration.url) { | ||||
66 | folderView.url = plasmoid.configuration.url; | ||||
67 | folderView.history = []; | ||||
68 | folderView.updateHistory(); | ||||
69 | } | ||||
70 | } | ||||
71 | | ||||
64 | PlasmaCore.Svg { | 72 | PlasmaCore.Svg { | ||
65 | id: actionOverlays | 73 | id: actionOverlays | ||
66 | 74 | | |||
67 | imagePath: "widgets/action-overlays" | 75 | imagePath: "widgets/action-overlays" | ||
68 | multipleImages: true | 76 | multipleImages: true | ||
69 | size: "16x16" | 77 | size: "16x16" | ||
70 | } | 78 | } | ||
71 | 79 | | |||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 130 | PlasmaComponents.Label { | |||
129 | wrapMode: Text.Wrap | 137 | wrapMode: Text.Wrap | ||
130 | } | 138 | } | ||
131 | 139 | | |||
132 | Connections { | 140 | Connections { | ||
133 | target: plasmoid | 141 | target: plasmoid | ||
134 | 142 | | |||
135 | onExpandedChanged: { | 143 | onExpandedChanged: { | ||
136 | if (root.isPopup && !plasmoid.expanded) { | 144 | if (root.isPopup && !plasmoid.expanded) { | ||
137 | if (folderView.url != plasmoid.configuration.url) { | 145 | goHome(); | ||
138 | folderView.url = plasmoid.configuration.url; | | |||
139 | folderView.history = []; | | |||
140 | folderView.updateHistory(); | | |||
141 | } | | |||
142 | 146 | | |||
143 | folderView.currentIndex = -1; | 147 | folderView.currentIndex = -1; | ||
144 | folderView.model.clearSelection(); | 148 | folderView.model.clearSelection(); | ||
145 | folderView.cancelRename(); | 149 | folderView.cancelRename(); | ||
146 | } | 150 | } | ||
147 | } | 151 | } | ||
148 | 152 | | |||
149 | onExternalData: { | 153 | onExternalData: { | ||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 241 | Item { | |||
242 | readonly property bool active: (plasmoid.configuration.labelMode != 0) | 246 | readonly property bool active: (plasmoid.configuration.labelMode != 0) | ||
243 | 247 | | |||
244 | width: parent.width | 248 | width: parent.width | ||
245 | height: active ? labelHeight : 0 | 249 | height: active ? labelHeight : 0 | ||
246 | 250 | | |||
247 | visible: active | 251 | visible: active | ||
248 | 252 | | |||
249 | property Item windowPin: null | 253 | property Item windowPin: null | ||
254 | property Item homeButton: null | ||||
250 | 255 | | |||
251 | onVisibleChanged: { | 256 | onVisibleChanged: { | ||
252 | if (root.isPopup && !visible) { | 257 | if (root.isPopup && !visible) { | ||
253 | plasmoid.hideOnWindowDeactivate = true; | 258 | plasmoid.hideOnWindowDeactivate = true; | ||
254 | } | 259 | } | ||
255 | } | 260 | } | ||
256 | 261 | | |||
257 | Connections { | 262 | Connections { | ||
258 | target: root | 263 | target: root | ||
259 | 264 | | |||
260 | onIsPopupChanged: { | 265 | onIsPopupChanged: { | ||
261 | if (windowPin == null && root.isPopup) { | 266 | if (windowPin == null && root.isPopup) { | ||
262 | windowPin = windowPinComponent.createObject(label); | 267 | windowPin = windowPinComponent.createObject(label); | ||
263 | } else if (upButton != null) { | 268 | } else if (upButton != null) { | ||
264 | windowPin.destroy(); | 269 | windowPin.destroy(); | ||
265 | } | 270 | } | ||
266 | } | 271 | } | ||
267 | } | 272 | } | ||
268 | 273 | | |||
274 | Connections { | ||||
275 | target: folderView | ||||
276 | | ||||
277 | onUrlChanged: { | ||||
278 | if (!label.homeButton && folderView.url != plasmoid.configuration.url) { | ||||
279 | label.homeButton = homeButtonComponent.createObject(label); | ||||
280 | } else if (label.homeButton) { | ||||
281 | label.homeButton.destroy(); | ||||
282 | } | ||||
283 | } | ||||
284 | } | ||||
285 | | ||||
269 | PlasmaComponents.Label { | 286 | PlasmaComponents.Label { | ||
270 | id: text | 287 | id: text | ||
271 | 288 | | |||
272 | width: parent.width - (windowPin != null ? windowPin.width - units.smallSpacing : 0) | 289 | anchors { | ||
290 | left: label.homeButton ? label.homeButton.right : parent.left | ||||
291 | right: label.windowPin ? label.windowPin.left : parent.right | ||||
292 | margins: units.smallSpacing | ||||
293 | } | ||||
273 | height: parent.height | 294 | height: parent.height | ||
274 | 295 | | |||
275 | horizontalAlignment: Text.AlignHCenter | 296 | horizontalAlignment: Text.AlignHCenter | ||
276 | verticalAlignment: Text.AlignTop | 297 | verticalAlignment: Text.AlignTop | ||
277 | elide: Text.ElideMiddle | 298 | elide: Text.ElideMiddle | ||
278 | text: labelGenerator.displayLabel | 299 | text: labelGenerator.displayLabel | ||
279 | font.underline: labelMouseArea.containsMouse | 300 | font.underline: labelMouseArea.containsMouse | ||
280 | 301 | | |||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 341 | PlasmaComponents.ToolButton { | |||
327 | width: root.isPopup ? Math.round(units.gridUnit * 1.25) : 0 | 348 | width: root.isPopup ? Math.round(units.gridUnit * 1.25) : 0 | ||
328 | height: width | 349 | height: width | ||
329 | checkable: true | 350 | checkable: true | ||
330 | iconSource: "window-pin" | 351 | iconSource: "window-pin" | ||
331 | onCheckedChanged: plasmoid.hideOnWindowDeactivate = !checked | 352 | onCheckedChanged: plasmoid.hideOnWindowDeactivate = !checked | ||
332 | } | 353 | } | ||
333 | } | 354 | } | ||
334 | 355 | | |||
356 | Component { | ||||
357 | id: homeButtonComponent | ||||
358 | | ||||
359 | PlasmaComponents.ToolButton { | ||||
360 | id: homeButton | ||||
361 | | ||||
362 | anchors.left: parent.left | ||||
363 | | ||||
364 | visible: root.isPopup && folderView.url != plasmoid.configuration.url | ||||
365 | | ||||
366 | width: root.isPopup ? Math.round(units.gridUnit * 1.25) : 0 | ||||
367 | height: width | ||||
368 | iconSource: "go-home" | ||||
369 | | ||||
370 | onClicked: goHome() | ||||
371 | } | ||||
372 | } | ||||
373 | | ||||
335 | Component.onCompleted: { | 374 | Component.onCompleted: { | ||
336 | if (root.isPopup) { | 375 | if (root.isPopup) { | ||
337 | windowPin = windowPinComponent.createObject(label); | 376 | windowPin = windowPinComponent.createObject(label); | ||
338 | } | 377 | } | ||
339 | } | 378 | } | ||
340 | } | 379 | } | ||
341 | } | 380 | } | ||
342 | 381 | | |||
Show All 29 Lines |