SystemDialog: give minimumWidth a cap

having the width entirely dependent on the implicit size of the content
has the unfortunate side effect that a window can become insanely wide.
instead cap the minimum width at a percentage of the screen width.
shrinking beyond that cap then only allows dimension changes in height,
not width. this allows the content items to adjust accordingly (e.g.
labels would be forced to wrap).

NB: height is intentionally uncapped because we need somewhere to put
the "overflow" content
wilder-5.25
Harald Sitter 4 years ago committed by Nate Graham
parent 5430c3a029
commit 6d4a2071e8
  1. 2
      lookandfeel/contents/systemdialog/SystemDialog.qml

@ -29,7 +29,7 @@ Item {
implicitHeight: column.implicitHeight
implicitWidth: column.implicitWidth
readonly property real minimumHeight: column.Layout.minimumHeight + mainItem.implicitHeight + footerButtonBox.implicitHeight
readonly property real minimumWidth: column.Layout.minimumWidth + mainItem.implicitWidth + footerButtonBox.implicitWidth
readonly property real minimumWidth: Math.min(Math.round(Screen.width / 3), column.Layout.minimumWidth + mainItem.implicitWidth + footerButtonBox.implicitWidth)
readonly property int flags: Qt.Dialog
property alias standardButtons: footerButtonBox.standardButtons
readonly property int spacing: Kirigami.Units.largeSpacing // standard KDE dialog margins

Loading…
Cancel
Save