From 069b4e95c155c4f36b4756171586a617d70212c2 Mon Sep 17 00:00:00 2001 From: Camilo Higuita Date: Wed, 28 Aug 2019 08:59:24 -0500 Subject: [PATCH] make the sizing of the toolbuttons more coherent Summary: this makes the toolbutton icons follow a standard size. Maybe one could make it follow the icon group size props? like icon.width and icon.height if those props are set. Before patch: {F7274098} After patch: {F7274097} Reviewers: #plasma, mart, ngraham Reviewed By: #plasma, mart, ngraham Subscribers: broulik, apol, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D23367 --- .../plasmacomponents3/ToolButton.qml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/declarativeimports/plasmacomponents3/ToolButton.qml b/src/declarativeimports/plasmacomponents3/ToolButton.qml index 711d277e0..fe49f64b2 100644 --- a/src/declarativeimports/plasmacomponents3/ToolButton.qml +++ b/src/declarativeimports/plasmacomponents3/ToolButton.qml @@ -24,6 +24,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kirigami 2.5 as Kirigami import "private" as Private + T.ToolButton { id: control @@ -46,10 +47,13 @@ T.ToolButton { contentItem: RowLayout { PlasmaCore.IconItem { - Layout.fillWidth: true - Layout.fillHeight: true - colorGroup: PlasmaCore.ColorScope.colorGroup + id: icon visible: source.length > 0 + Layout.fillWidth: control.icon.width <= 0 + Layout.fillHeight: control.icon.height <= 0 + Layout.preferredWidth: control.icon.width > 0 ? control.icon.width : -1 + Layout.preferredHeight: control.icon.height > 0 ? control.icon.height : -1 + colorGroup: PlasmaCore.ColorScope.colorGroup source: control.icon ? (control.icon.name || control.icon.source) : "" } Label {