From 6d4a2071e84f6dd023b4ff77fa2d423ea2f5fe12 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Thu, 21 Apr 2022 18:15:13 +0000 Subject: [PATCH] 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 --- lookandfeel/contents/systemdialog/SystemDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lookandfeel/contents/systemdialog/SystemDialog.qml b/lookandfeel/contents/systemdialog/SystemDialog.qml index b121436db..839cfcf62 100644 --- a/lookandfeel/contents/systemdialog/SystemDialog.qml +++ b/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