Skip to content

Dialog: Expand past preferred size to implicit size, as documented

Jakob Petsovits requested to merge work/jpetso/dialog-autoexpand into master

Different (imho better) approach than MR !1517 to protect against content getting cut off.


The documentation of preferred{Height,Width} says:

If the content, header or footer require more space, then the [size] of the dialog will expand to the necessary amount of space.

However, in practice, a PromptDialog with preferredWidth set to a multiple of Kirigami.Units.gridUnit would cut off its wider main item on the right, despite it not exceeding maximum width.

Instead of choosing preferred size or implicit size based on whether preferred size is set, pick the larger one instead. This will work fine with the default of preferred{Height,Width} == -1 and auto-expand as advertised.

Merge request reports