support icon.width/height
Summary: support the icon size hint of the control. Reinstate it in ToolButton and add the support for the other controls CCBUG:417514 Test Plan: possible to control buttons icon sizes mediacontroller taskbar tooltip with icons set to small: {F8103363} Reviewers: #plasma, broulik Reviewed By: #plasma, broulik Subscribers: broulik, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27396
This commit is contained in:
parent
1ed47e7c41
commit
3de1c2462e
@ -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) : ""
|
||||
|
@ -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
|
||||
|
@ -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) : ""
|
||||
|
Loading…
Reference in New Issue
Block a user