plasma-framework/tests/components/button3.qml
Nate Graham 711789908b Drop implicit minimum sizing from PC2 and PC3 Buttons
For the following reasons:
- It can break and look bad on Plasma Mobile which uses the Plasma style
- It makes buttons with icons and short text look visually unbalanced
- QStyle and QML desktop style buttons do not do this so it's a source
  of inconsistency

Tests are adjusted to all pass. Stuff looks better to my eye.
2020-08-10 18:47:49 +00:00

132 lines
3.4 KiB
QML

import QtQuick 2.0
import org.kde.plasma.components 3.0 as PlasmaComponents
import QtQuick.Layouts 1.2
ComponentBase {
Grid {
anchors.fill: parent
anchors.margins: 20
spacing: 20
columns: 2
PlasmaComponents.Label {
text: "icon + text"
}
PlasmaComponents.Button {
icon.name: "list-remove"
text: "test"
}
PlasmaComponents.Label {
text: "icon alone, should look small and square"
}
PlasmaComponents.Button {
icon.name: "list-remove"
}
PlasmaComponents.Label {
text: "text alone, should be about as wide as the text itself"
}
PlasmaComponents.Button {
text: "test"
}
PlasmaComponents.Label {
text: "This should look highlighted on load"
}
PlasmaComponents.Button {
text: "test"
focus: true
}
PlasmaComponents.Label {
text: "long text, should expand to fit"
}
PlasmaComponents.Button {
icon.name: "list-remove"
text: "This is a really really really really long button"
}
PlasmaComponents.Label {
text: "long text but constrained, should be 150px and elided"
}
PlasmaComponents.Button {
icon.name: "list-remove"
text: "This is a really really really really long button"
width: 150
}
PlasmaComponents.Label {
text: "button (with or without icon) and textfield should have the same height"
}
RowLayout {
PlasmaComponents.Button {
text: "test"
}
PlasmaComponents.Button {
icon.name: "application-menu"
text: "test"
}
PlasmaComponents.TextField {
}
}
PlasmaComponents.Label {
text: "minimum width property. Should be two letters wide"
}
RowLayout {
PlasmaComponents.Button {
text: "AA"
implicitWidth: Layout.minimumWidth
}
PlasmaComponents.Button {
icon.name: "application-menu"
text: "AA"
implicitWidth: Layout.minimumWidth
}
PlasmaComponents.Button {
icon.name: "application-menu"
implicitWidth: Layout.minimumWidth
}
}
PlasmaComponents.Label {
text: "Display property"
}
RowLayout {
PlasmaComponents.Button {
icon.name: "application-menu"
text: "Icon Only"
display: PlasmaComponents.Button.IconOnly
}
PlasmaComponents.Button {
icon.name: "application-menu"
text: "Text Beside Icon"
display: PlasmaComponents.Button.TextBesideIcon
}
PlasmaComponents.Button {
icon.name: "application-menu"
text: "Text Under Icon"
display: PlasmaComponents.Button.TextUnderIcon
}
PlasmaComponents.Button {
icon.name: "application-menu"
text: "Text Only"
display: PlasmaComponents.Button.TextOnly
}
}
}
}