summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2017-01-16 15:04:39 +0100
committerKai Uwe Broulik <[email protected]>2017-01-16 15:04:39 +0100
commitdc6948230f1f7f1c9618df3822e12c6dbe6ecc2e (patch)
treed5d2aee90f0ca64df5571c80113f2cd04a00e5ca
parent3ec2ae710d144933035cbe15ece2b529d979d6bd (diff)
[User Switcher] Just use Row's implicitWidth instead of calculating it manually
I don't know what I was thinking when I implemented this but just use implicitWidth which is the correct width. Fixes the label potentially being wider than the applet swallowing the right panel margin when placed at the end of a panel. Differential Revision: https://phabricator.kde.org/D4160
-rw-r--r--applets/userswitcher/package/contents/ui/main.qml4
1 files changed, 1 insertions, 3 deletions
diff --git a/applets/userswitcher/package/contents/ui/main.qml b/applets/userswitcher/package/contents/ui/main.qml
index a0e0f5e..29b3b36 100644
--- a/applets/userswitcher/package/contents/ui/main.qml
+++ b/applets/userswitcher/package/contents/ui/main.qml
@@ -69,7 +69,7 @@ Item {
// Taken from DigitalClock to ensure uniform sizing when next to each other
readonly property bool tooSmall: plasmoid.formFactor === PlasmaCore.Types.Horizontal && Math.round(2 * (compactRoot.height / 5)) <= theme.smallestFont.pixelSize
- Layout.minimumWidth: isVertical ? 0 : compactRow.contentWidth
+ Layout.minimumWidth: isVertical ? 0 : compactRow.implicitWidth
Layout.maximumWidth: isVertical ? Infinity : Layout.minimumWidth
Layout.preferredWidth: isVertical ? undefined : Layout.minimumWidth
@@ -82,8 +82,6 @@ Item {
Row {
id: compactRow
- readonly property int contentWidth: (icon.visible ? icon.width : 0) + (icon.visible && label.visible ? spacing : 0) + (label.visible ? label.contentWidth : 0)
-
anchors.centerIn: parent
spacing: units.smallSpacing