[PC3/button] Elide text always

Summary:
We always want the label to have the width managed by the layout to fill
all available space.

Test Plan:
In tests/components/button3.qml the test

"long text but constrained, should be 150px and elided" now is correctly
elided rather than the text spewing past the end of the button. The text
does not overlap the icon.

Reviewers: #plasma, apol, ngraham

Reviewed By: apol, ngraham

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D24909
This commit is contained in:
David Edmundson 2019-10-25 15:44:46 +01:00
parent 1076864048
commit 12edce87bb

View File

@ -52,7 +52,7 @@ T.Button {
source: control.icon ? (control.icon.name || control.icon.source) : ""
}
Label {
Layout.fillWidth: !icon.visible
Layout.fillWidth: true
Layout.fillHeight: true
visible: text.length > 0
text: control.Kirigami.MnemonicData.richTextLabel