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
wilder-5.14
Michail Vourlakos 9 years ago
parent 8eb03288ed
commit 40cc6c359c
  1. 14
      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: {

Loading…
Cancel
Save