Commit 0dad5f07 authored by Nate Graham's avatar Nate Graham
Browse files

kcms/users: don't let "Choose File…" text overflow

When using a language that's wordier than English and this label becomes
a two-line string, currently the layout breaks and the string overflows
because the Label item that draws it has no maximum height and elision
mode set.

This commit fixes that by setting them accordingly, and also using a
standard icon size for the icon so that there's actually enough room for
two lines of text.

BUG: 458614
FIXED-IN: 5.24.7
parent 5b5b79ff
Pipeline #227720 passed with stage
in 10 minutes and 43 seconds
......@@ -281,28 +281,38 @@ SimpleKCM {
Layout.rightMargin: Kirigami.Units.largeSpacing
QQC2.Button {
id: openButton
Layout.preferredHeight: Kirigami.Units.gridUnit * 6
Layout.preferredWidth: Layout.preferredHeight
ColumnLayout {
anchors.centerIn: parent
contentItem: Item {
ColumnLayout {
// Centering rather than filling is desired to keep the
// entire layout nice and tight when the text is short
anchors.centerIn: parent
spacing: 0 // the icon should bring its own
Kirigami.Icon {
implicitWidth: Kirigami.Units.gridUnit * 4
implicitHeight: Kirigami.Units.gridUnit * 4
source: "document-open"
Kirigami.Icon {
id: openIcon
Layout.alignment: Qt.AlignHCenter
}
QQC2.Label {
text: i18n("Choose File…")
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom
fontSizeMode: Text.HorizontalFit
wrapMode: Text.Wrap
Layout.fillWidth: true
Layout.maximumWidth: Kirigami.Units.gridUnit * 5
implicitWidth: Kirigami.Units.iconSizes.huge
implicitHeight: Kirigami.Units.iconSizes.huge
source: "document-open"
Layout.alignment: Qt.AlignHCenter
}
QQC2.Label {
text: i18n("Choose File…")
Layout.fillWidth: true
Layout.maximumWidth: Kirigami.Units.gridUnit * 5
Layout.maximumHeight: openButton.availableHeight - openIcon.height
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignBottom
fontSizeMode: Text.HorizontalFit
wrapMode: Text.Wrap
elide: Text.ElideRight
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment