diff --git a/src/declarativeimports/plasmacomponents3/Button.qml b/src/declarativeimports/plasmacomponents3/Button.qml index 83ff82276..b642c029d 100644 --- a/src/declarativeimports/plasmacomponents3/Button.qml +++ b/src/declarativeimports/plasmacomponents3/Button.qml @@ -45,8 +45,12 @@ T.Button { contentItem: RowLayout { PlasmaCore.IconItem { id: icon - Layout.fillWidth: true - Layout.fillHeight: true + + Layout.fillWidth: control.icon.width <= 0 + Layout.fillHeight: control.icon.height <= 0 + Layout.preferredWidth: control.icon.width > 0 ? control.icon.width : units.iconSizes.small + Layout.preferredHeight: control.icon.height > 0 ? control.icon.height : units.iconSizes.small + colorGroup: PlasmaCore.Theme.ButtonColorGroup visible: source.length > 0 source: control.icon ? (control.icon.name || control.icon.source) : "" diff --git a/src/declarativeimports/plasmacomponents3/TabButton.qml b/src/declarativeimports/plasmacomponents3/TabButton.qml index bfa5c4df4..b500e808e 100644 --- a/src/declarativeimports/plasmacomponents3/TabButton.qml +++ b/src/declarativeimports/plasmacomponents3/TabButton.qml @@ -44,8 +44,12 @@ T.TabButton { columns: control.display == T.AbstractButton.TextBesideIcon ? 2 : 1 PlasmaCore.IconItem { id: icon - Layout.fillWidth: true - Layout.fillHeight: true + + Layout.fillWidth: control.icon.width <= 0 + Layout.fillHeight: control.icon.height <= 0 + Layout.preferredWidth: control.icon.width > 0 ? control.icon.width : units.iconSizes.smallMedium + Layout.preferredHeight: control.icon.height > 0 ? control.icon.height : units.iconSizes.smallMedium + colorGroup: PlasmaCore.Theme.ButtonColorGroup visible: source.length > 0 source: control.icon ? (control.icon.name || control.icon.source) : "" @@ -58,7 +62,6 @@ T.TabButton { text: control.Kirigami.MnemonicData.richTextLabel font: control.font opacity: enabled || control.highlighted || control.checked ? 1 : 0.4 - color: control.activeFocus && !control.down ? theme.highlightedTextColor : theme.buttonTextColor horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter elide: Text.ElideRight diff --git a/src/declarativeimports/plasmacomponents3/ToolButton.qml b/src/declarativeimports/plasmacomponents3/ToolButton.qml index 4949393d0..113a9c675 100644 --- a/src/declarativeimports/plasmacomponents3/ToolButton.qml +++ b/src/declarativeimports/plasmacomponents3/ToolButton.qml @@ -49,8 +49,12 @@ T.ToolButton { columns: control.display == T.AbstractButton.TextBesideIcon ? 2 : 1 PlasmaCore.IconItem { id: icon - Layout.fillWidth: true - Layout.fillHeight: true + + Layout.fillWidth: control.icon.width <= 0 + Layout.fillHeight: control.icon.height <= 0 + Layout.preferredWidth: control.icon.width > 0 ? control.icon.width : units.iconSizes.smallMedium + Layout.preferredHeight: control.icon.height > 0 ? control.icon.height : units.iconSizes.smallMedium + colorGroup: PlasmaCore.Theme.ButtonColorGroup visible: source.length > 0 source: control.icon ? (control.icon.name || control.icon.source) : ""