summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2017-03-28 10:58:29 +0200
committerKai Uwe Broulik <[email protected]>2017-03-28 10:58:29 +0200
commitfc94d0f2fd3ebd3d087f4cc433d1e84a476b2177 (patch)
tree6281b378c26dbe7eb8240344d5a2a7815f53c8ea
parent2f607969ecd43e9f46941062b8f692a0ed32377c (diff)
[Folder View] Show pin icon only if really in a popup
When placed in a wide panel, Folder View would reveal its contents but the pin icon was still there. Differential Revision: https://phabricator.kde.org/D5204
-rw-r--r--containments/desktop/package/contents/ui/FolderViewLayer.qml20
1 files changed, 9 insertions, 11 deletions
diff --git a/containments/desktop/package/contents/ui/FolderViewLayer.qml b/containments/desktop/package/contents/ui/FolderViewLayer.qml
index dfc1a44..b51ec5d 100644
--- a/containments/desktop/package/contents/ui/FolderViewLayer.qml
+++ b/containments/desktop/package/contents/ui/FolderViewLayer.qml
@@ -245,6 +245,8 @@ Item {
// propagates recursively) and that confuses the Label, hence the temp property.
readonly property bool active: (plasmoid.configuration.labelMode != 0)
+ readonly property bool showPin: root.isPopup && plasmoid.compactRepresentationItem && plasmoid.compactRepresentationItem.visible
+
width: parent.width
height: active ? labelHeight : 0
@@ -259,15 +261,11 @@ Item {
}
}
- Connections {
- target: root
-
- onIsPopupChanged: {
- if (windowPin == null && root.isPopup) {
- windowPin = windowPinComponent.createObject(label);
- } else if (upButton != null) {
- windowPin.destroy();
- }
+ onShowPinChanged: {
+ if (!windowPin && showPin) {
+ windowPin = windowPinComponent.createObject(label);
+ } else if (windowPin) {
+ windowPin.destroy();
}
}
@@ -343,7 +341,7 @@ Item {
anchors.right: parent.right
- visible: root.isPopup
+ visible: label.showPin
width: root.isPopup ? Math.round(units.gridUnit * 1.25) : 0
height: width
@@ -372,7 +370,7 @@ Item {
}
Component.onCompleted: {
- if (root.isPopup) {
+ if (root.showPin) {
windowPin = windowPinComponent.createObject(label);
}
}