From 40cc6c359cb5417fd137b34cf5d73d3f97e8ddb4 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 20 May 2017 14:22:36 +0300 Subject: [PATCH] improve positioning for highlight in systray Summary: --the highlight item used in the systray now uses the panel thickness for correct positioning. In the past there were cases that the highlight item wasnt shown at all or was positioned a bit far from the panel edge Test Plan: use the systray and investigate that highlight item is positioned correctly Reviewers: #plasma, mart, davidedmundson Reviewed By: mart Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5927 --- .../package/contents/ui/CurrentItemHighLight.qml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/applets/systemtray/package/contents/ui/CurrentItemHighLight.qml b/applets/systemtray/package/contents/ui/CurrentItemHighLight.qml index 36e410339..69644924f 100644 --- a/applets/systemtray/package/contents/ui/CurrentItemHighLight.qml +++ b/applets/systemtray/package/contents/ui/CurrentItemHighLight.qml @@ -18,6 +18,7 @@ */ import QtQuick 2.1 +import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore PlasmaCore.FrameSvgItem { @@ -27,10 +28,15 @@ PlasmaCore.FrameSvgItem { property Item target property int location - x: Math.max(0, (target ? target.x : 0) + (visualParent ? visualParent.x : 0)) - y: Math.max(0, (target ? target.y : 0) + (visualParent ? visualParent.y : 0)) - width: Math.min(parent.width, target ? target.width : 0) - height: Math.min(parent.height, target ? target.height : 0) + //! when the target is the root item we use the maximum thickness of the panel + x: plasmoid.formFactor === PlasmaCore.Types.Vertical && target === root ? + 0 : Math.max(0, (target ? target.x : 0) + (visualParent ? visualParent.x : 0)) + y: plasmoid.formFactor === PlasmaCore.Types.Horizontal && target === root ? + 0 : Math.max(0, (target ? target.y : 0) + (visualParent ? visualParent.y : 0)) + width: plasmoid.formFactor === PlasmaCore.Types.Vertical && target === root ? + parent.width : Math.min(parent.width, target ? target.width : 0) + height: plasmoid.formFactor === PlasmaCore.Types.Horizontal && target === root ? + parent.height : Math.min(parent.height, target ? target.height : 0) imagePath: "widgets/tabbar" prefix: {