[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
This commit is contained in:
Kai Uwe Broulik 2017-02-06 15:20:08 +01:00
parent 1b02bfdff7
commit c21ff749e6
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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