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
This commit is contained in:
Camilo Higuita 2019-08-28 08:59:24 -05:00
parent 86021afdf5
commit 069b4e95c1

View File

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