From f31e7860d98f3c66888f1102a7cf3c47f31e2a59 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Fri, 26 Jan 2018 15:49:06 +0100 Subject: [PATCH] [Default Tooltip] Fix sizing Unset the Label's default height which completely confuses the renderer either shifting the item vertically (e.g. when toggling system tray popup), or letting it get too wide (e.g. when moving from a two-line tooltip to a one-line tooltip). Also let the Layouts figure out sizing rather than trying to overrule it with flaky values. BUG: 386260 BUG: 389371 Differential Revision: https://phabricator.kde.org/D10077 --- .../core/private/DefaultToolTip.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/declarativeimports/core/private/DefaultToolTip.qml b/src/declarativeimports/core/private/DefaultToolTip.qml index 72ffecaa3..223b07c7b 100644 --- a/src/declarativeimports/core/private/DefaultToolTip.qml +++ b/src/declarativeimports/core/private/DefaultToolTip.qml @@ -66,13 +66,12 @@ Item { } ColumnLayout { + Layout.maximumWidth: preferredTextWidth PlasmaExtras.Heading { id: tooltipMaintext level: 3 - property int _width: Math.min(implicitWidth, preferredTextWidth) - Layout.minimumWidth: _width - Layout.maximumWidth: preferredTextWidth + Layout.fillWidth: true elide: Text.ElideRight wrapMode: Text.Wrap text: toolTip ? toolTip.mainText : "" @@ -80,9 +79,10 @@ Item { } PlasmaComponents.Label { id: tooltipSubtext - property int _width: Math.min(implicitWidth, preferredTextWidth) - Layout.minimumWidth: _width - Layout.maximumWidth: preferredTextWidth + Layout.fillWidth: true + // Unset Label default height, confuses the layout engine completely + // either shifting the item vertically or letting it get too wide + height: undefined wrapMode: Text.WordWrap text: toolTip ? toolTip.subText : "" textFormat: toolTip ? toolTip.textFormat : Text.AutoText