Buttons: allow to scale up icons
Summary: always scale icons unless a size is specified in the api. this makes icon sizing more in line with plasma components 2 Test Plan: {F8129062} {F8129064} {F8129065} Reviewers: #plasma, broulik Reviewed By: #plasma, broulik Subscribers: broulik, ngraham, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27628
This commit is contained in:
parent
b7fa6e0e91
commit
0b89e7f3f0
@ -54,16 +54,17 @@ T.Button {
|
|||||||
|
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
|
||||||
Layout.fillWidth: control.display === T.Button.TextUnderIcon
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: control.display !== T.Button.TextUnderIcon
|
Layout.fillHeight: true
|
||||||
|
|
||||||
Layout.minimumWidth: units.iconSizes.tiny
|
Layout.minimumWidth: Math.min(parent.width, parent.height, implicitWidth)
|
||||||
Layout.minimumHeight: units.iconSizes.tiny
|
Layout.minimumHeight: Math.min(parent.width, parent.height, implicitHeight)
|
||||||
Layout.maximumWidth: control.icon.width > 0 ? control.icon.width : units.iconSizes.small
|
|
||||||
Layout.maximumHeight: control.icon.height > 0 ? control.icon.height : units.iconSizes.small
|
|
||||||
|
|
||||||
implicitWidth: Layout.maximumWidth
|
Layout.maximumWidth: control.icon.width > 0 ? control.icon.width : Number.POSITIVE_INFINITY
|
||||||
implicitHeight: Layout.maximumHeight
|
Layout.maximumHeight: control.icon.height > 0 ? control.icon.height : Number.POSITIVE_INFINITY
|
||||||
|
|
||||||
|
implicitWidth: control.icon.width > 0 ? control.icon.width : units.iconSizes.small
|
||||||
|
implicitHeight: control.icon.height > 0 ? control.icon.height : units.iconSizes.small
|
||||||
|
|
||||||
colorGroup: PlasmaCore.Theme.ButtonColorGroup
|
colorGroup: PlasmaCore.Theme.ButtonColorGroup
|
||||||
visible: source.length > 0 && control.display !== T.Button.TextOnly
|
visible: source.length > 0 && control.display !== T.Button.TextOnly
|
||||||
|
@ -47,16 +47,17 @@ T.TabButton {
|
|||||||
|
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
|
||||||
Layout.fillWidth: control.display === T.AbstractButton.TextUnderIcon
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: control.display !== T.AbstractButton.TextUnderIcon
|
Layout.fillHeight: true
|
||||||
|
|
||||||
Layout.minimumWidth: units.iconSizes.tiny
|
Layout.minimumWidth: Math.min(parent.width, parent.height, implicitWidth)
|
||||||
Layout.minimumHeight: units.iconSizes.tiny
|
Layout.minimumHeight: Math.min(parent.width, parent.height, implicitHeight)
|
||||||
Layout.maximumWidth: control.icon.width > 0 ? control.icon.width : units.iconSizes.smallMedium
|
|
||||||
Layout.maximumHeight: control.icon.height > 0 ? control.icon.height : units.iconSizes.smallMedium
|
|
||||||
|
|
||||||
implicitWidth: Layout.maximumWidth
|
Layout.maximumWidth: control.icon.width > 0 ? control.icon.width : Number.POSITIVE_INFINITY
|
||||||
implicitHeight: Layout.maximumHeight
|
Layout.maximumHeight: control.icon.height > 0 ? control.icon.height : Number.POSITIVE_INFINITY
|
||||||
|
|
||||||
|
implicitWidth: control.icon.width > 0 ? control.icon.width : units.iconSizes.smallMedium
|
||||||
|
implicitHeight: control.icon.height > 0 ? control.icon.height : units.iconSizes.smallMedium
|
||||||
|
|
||||||
colorGroup: control.PlasmaCore.ColorScope.colorGroup
|
colorGroup: control.PlasmaCore.ColorScope.colorGroup
|
||||||
visible: source.length > 0 && control.display !== T.AbstractButton.TextOnly
|
visible: source.length > 0 && control.display !== T.AbstractButton.TextOnly
|
||||||
|
@ -56,16 +56,17 @@ T.ToolButton {
|
|||||||
|
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
|
||||||
Layout.fillWidth: control.display === T.AbstractButton.TextUnderIcon
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: control.display !== T.AbstractButton.TextUnderIcon
|
Layout.fillHeight: true
|
||||||
|
|
||||||
Layout.minimumWidth: units.iconSizes.tiny
|
Layout.minimumWidth: Math.min(parent.width, parent.height, implicitWidth)
|
||||||
Layout.minimumHeight: units.iconSizes.tiny
|
Layout.minimumHeight: Math.min(parent.width, parent.height, implicitHeight)
|
||||||
Layout.maximumWidth: control.icon.width > 0 ? control.icon.width : units.iconSizes.smallMedium
|
|
||||||
Layout.maximumHeight: control.icon.height > 0 ? control.icon.height : units.iconSizes.smallMedium
|
|
||||||
|
|
||||||
implicitWidth: Layout.maximumWidth
|
Layout.maximumWidth: control.icon.width > 0 ? control.icon.width : Number.POSITIVE_INFINITY
|
||||||
implicitHeight: Layout.maximumHeight
|
Layout.maximumHeight: control.icon.height > 0 ? control.icon.height : Number.POSITIVE_INFINITY
|
||||||
|
|
||||||
|
implicitWidth: control.icon.width > 0 ? control.icon.width : units.iconSizes.smallMedium
|
||||||
|
implicitHeight: control.icon.height > 0 ? control.icon.height : units.iconSizes.smallMedium
|
||||||
|
|
||||||
colorGroup: control.PlasmaCore.ColorScope.colorGroup
|
colorGroup: control.PlasmaCore.ColorScope.colorGroup
|
||||||
visible: source.length > 0 && control.display !== T.AbstractButton.TextOnly
|
visible: source.length > 0 && control.display !== T.AbstractButton.TextOnly
|
||||||
|
@ -80,6 +80,43 @@ ComponentBase {
|
|||||||
icon.name: "list-remove"
|
icon.name: "list-remove"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
PlasmaComponents.Label {
|
||||||
|
text: "Fixed size and stretching size buttons"
|
||||||
|
}
|
||||||
|
GridLayout {
|
||||||
|
id: layout
|
||||||
|
rows: 2
|
||||||
|
columns:2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
PlasmaComponents.ToolButton {
|
||||||
|
id: closeButton
|
||||||
|
icon.name: "window-close"
|
||||||
|
text: "Text"
|
||||||
|
}
|
||||||
|
PlasmaComponents.ToolButton {
|
||||||
|
id: closeButton2
|
||||||
|
icon.name: "window-close"
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
icon.width: units.iconSizes.small
|
||||||
|
icon.height: units.iconSizes.small
|
||||||
|
text: "Text"
|
||||||
|
}
|
||||||
|
PlasmaComponents.ToolButton {
|
||||||
|
id: closeButton3
|
||||||
|
icon.name: "window-close"
|
||||||
|
Layout.fillHeight: true
|
||||||
|
text: "Text"
|
||||||
|
}
|
||||||
|
PlasmaComponents.ToolButton {
|
||||||
|
id: closeButton4
|
||||||
|
icon.name: "window-close"
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
text: "Text"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user