Bug 465925 - DialogButtonBox does not respect explicit width constraint, overflows, and does not scroll
Summary: DialogButtonBox does not respect explicit width constraint, overflows, and do...
Status: CONFIRMED
Alias: None
Product: frameworks-qqc2-desktop-style
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-17 13:57 UTC by ratijas
Modified: 2023-02-17 23:08 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
DialogButtonBox - moving to the left (251.32 KB, video/mp4)
2023-02-17 13:59 UTC, ratijas
Details
DialogButtonBox - moving to the left (20.34 KB, image/png)
2023-02-17 13:59 UTC, ratijas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ratijas 2023-02-17 13:57:17 UTC
SUMMARY

With current implementation[1] of Kirigami.Dialog, dialog footer's implicit size is not honored, so it's possible to get a dialog smaller than what footer wanted to be. Regardless of that Kirigami issue, Kirigami.Dialog is a subtype of QQC2 Templates Popup, so it's constrained by its parent window size minus margins, so dialog can't count on its implicit size being honored anyway.

The problem is, qqc2-desktop-style implementation of DialogButtonBox is not adaptive to explicit size constraints:

1. It does not clip its buttons, so they overflow;
2. They don't scroll horizontally, even though they are in a ListView;
3. The less space you give to DialogButtonBox to accommodate itself, the more it moves to the left. o_O

STEPS TO REPRODUCE
1. Run snippet[2] in qmlscene
2. Resize window (shrink, stretch)

OBSERVED RESULT
a) Without Kirigami patch, Dialog is zero-width. It does not respect footer size, so all its DialogButtonBox buttons are invisible. With Kirigami patch, only right dialog's "Yahaha" button is visible which does not belong to DialogButtonBox anyway (added through customFooterActions).
b) DialogButtonBox moves to the left when there is no enough space for it, i.e. width < implicitWidth.

EXPECTED RESULT
DialogButtonBox should not move to the left, leaving empty space on the right. DialogButtonBox should react "properly" to width constraints, either wrapping in multiple lines, or scrolling horizontally, or both.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: git-master (kf5)
Qt Version: 5.15.8
Kernel Version: 6.1.11-arch1-1 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION

[1]: https://invent.kde.org/frameworks/kirigami/-/issues/41
[2]: https://invent.kde.org/frameworks/qqc2-desktop-style/-/snippets/2508
Comment 1 ratijas 2023-02-17 13:59:03 UTC
Created attachment 156367 [details]
DialogButtonBox - moving to the left
Comment 2 ratijas 2023-02-17 13:59:43 UTC
Created attachment 156368 [details]
DialogButtonBox - moving to the left
Comment 3 Nate Graham 2023-02-17 23:08:29 UTC
Oh the humanity!