Bug 465925

Summary: DialogButtonBox does not respect explicit width constraint, overflows, and does not scroll
Product: [Frameworks and Libraries] frameworks-qqc2-desktop-style Reporter: ratijas <me>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: ahiemstra, kde, nate, noahadvs, notmart
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: DialogButtonBox - moving to the left
DialogButtonBox - moving to the left

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!