diff --git a/declarativeimports/plasmacomponents/qml/ToolButton.qml b/declarativeimports/plasmacomponents/qml/ToolButton.qml index 79e3fb54c..8be4a6315 100644 --- a/declarativeimports/plasmacomponents/qml/ToolButton.qml +++ b/declarativeimports/plasmacomponents/qml/ToolButton.qml @@ -92,7 +92,7 @@ Item { enabled: defaultAction == undefined || defaultAction.enabled //icon + label + left margin + right margin + spacing between icon and text - property real minimumWidth: icon.width + label.preferredWidth + delegate.margins.left + delegate.margins.right + ((icon.valid) ? delegate.margins.left : 0) + property real minimumWidth: theme.smallIconSize + label.preferredWidth + delegate.margins.left + delegate.margins.right + ((icon.valid) ? delegate.margins.left : 0) property real minimumHeight: Math.max(theme.smallIconSize, label.paintedHeight) + delegate.margins.top + delegate.margins.bottom implicitWidth: { @@ -370,6 +370,8 @@ Item { icon.anchors.left = label.paintedWidth > 0 ? icon.parent.left : undefined } + property int preferredWidth: button.width < button.implicitWidth ? paintedWidth: paintedWidth + anchors { top: parent.top bottom: parent.bottom