From c21ff749e6467d4fdf3017e423471ea756218863 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 6 Feb 2017 15:20:08 +0100 Subject: [PATCH] [Button Styles] Use Layout.fillHeight instead of parent.height in a Layout This fixes the label not being vertically centered if the button is smaller than its implicit height. This can happen with the global menu applet in a narrow panel. BUG: 375911 Differential Revision: https://phabricator.kde.org/D4436 --- src/declarativeimports/plasmastyle/ButtonStyle.qml | 2 +- src/declarativeimports/plasmastyle/ToolButtonStyle.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarativeimports/plasmastyle/ButtonStyle.qml b/src/declarativeimports/plasmastyle/ButtonStyle.qml index 670a4a01f..c656cbef2 100644 --- a/src/declarativeimports/plasmastyle/ButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/ButtonStyle.qml @@ -75,7 +75,7 @@ QtQuickControlStyle.ButtonStyle { font: control.font || theme.defaultFont visible: control.text != "" Layout.fillWidth: true - height: parent.height + Layout.fillHeight: true color: theme.buttonTextColor horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter verticalAlignment: Text.AlignVCenter diff --git a/src/declarativeimports/plasmastyle/ToolButtonStyle.qml b/src/declarativeimports/plasmastyle/ToolButtonStyle.qml index b1e1be620..502138ad4 100644 --- a/src/declarativeimports/plasmastyle/ToolButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/ToolButtonStyle.qml @@ -90,7 +90,7 @@ QtQuickControlStyle.ButtonStyle { font: control.font || theme.defaultFont visible: control.text != "" Layout.fillWidth: true - height: parent.height + Layout.fillHeight: true color: controlHovered || !flat ? theme.buttonTextColor : PlasmaCore.ColorScope.textColor horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter verticalAlignment: Text.AlignVCenter