From 9d27675c3b4e37e3850c97c9feddd18d861cf8c9 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Mon, 10 Feb 2020 10:55:26 -0700 Subject: [PATCH] Vertically center tooltip icon/image Summary: Right now the widget tooltip's icon/image is top-aligned, which in practice makes it vertically centered when the tooltip has only one line of text, but not vertically centered when there are two lines of text. This patch makes it vertally centered all the time, improving the appearance. Test Plan: Before: {F8095695} After: {F8095696} {F8095697} Reviewers: #vdg, #plasma, filipf, ndavis Reviewed By: #vdg, filipf, ndavis Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27299 --- src/declarativeimports/core/private/DefaultToolTip.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarativeimports/core/private/DefaultToolTip.qml b/src/declarativeimports/core/private/DefaultToolTip.qml index 3a47be77f..9af361bf1 100644 --- a/src/declarativeimports/core/private/DefaultToolTip.qml +++ b/src/declarativeimports/core/private/DefaultToolTip.qml @@ -54,14 +54,14 @@ PlasmaCore.ColorScope { id: tooltipImage source: toolTip ? toolTip.image : "" visible: toolTip != null && toolTip.image != "" - Layout.alignment: Qt.AlignTop + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter } PlasmaCore.IconItem { id: tooltipIcon animated: false source: toolTip ? toolTip.icon : "" - Layout.alignment: Qt.AlignTop + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter visible: toolTip != null && toolTip.icon != "" && toolTip.image == "" && valid Layout.preferredWidth: units.iconSizes.medium Layout.preferredHeight: units.iconSizes.medium