From 882fc8d0ff94abc0cbddb34af1b2853f89dc16ca Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 4 Apr 2017 16:35:35 +0100 Subject: [PATCH] Keep system tray sidebar y position independent of current applet heading Summary: In the system tray we have a header at the top and the icons on the left. When there is no applet selected we want the icons to take up the full width, because of this they have to start off under the title. When an applet is selected we want these icons to dock to the left, but not change their y position. The title then becomes the title of the active applet. If the active applet's title wraps this results in the icons moving all over the place. See image in bug report. This patch uses two text fields and toggles visibility so that we can always align the icons to a consistent point BUG: 378194 Test Plan: Opened system tray with the arrow Clicked on an applet and back Opened system tray by clicking on applet Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5300 --- .../contents/ui/ExpandedRepresentation.qml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/applets/systemtray/package/contents/ui/ExpandedRepresentation.qml b/applets/systemtray/package/contents/ui/ExpandedRepresentation.qml index 94ad3488c..c4af24092 100644 --- a/applets/systemtray/package/contents/ui/ExpandedRepresentation.qml +++ b/applets/systemtray/package/contents/ui/ExpandedRepresentation.qml @@ -70,7 +70,8 @@ Item { } } - text: activeApplet ? activeApplet.title : i18n("Status & Notifications") + visible: activeApplet + text: activeApplet.title || "" MouseArea { anchors.fill: parent onClicked: { @@ -81,6 +82,19 @@ Item { } } } + PlasmaExtras.Heading { + id: noAppletHeading + level: 1 + anchors { + left: parent.left + top: parent.top + right: parent.right + topMargin: hiddenItemsView.visible ? units.smallSpacing : 0 + leftMargin: hiddenItemsView.iconColumnWidth + units.largeSpacing; + } + text: i18n("Status & Notifications") + visible: !heading.visible + } PlasmaCore.SvgItem { anchors { @@ -106,7 +120,8 @@ Item { id: hiddenItemsView anchors { left: parent.left - top: heading.bottom + top: noAppletHeading.bottom + topMargin: units.smallSpacing bottom: parent.bottom } }