KFileWidget: Perfectly align filename widget with icon view

Authored by rkflx on Apr 29 2018, 6:13 AM.



Since the redesign of the file dialog for KDE4, the left edges of the
line edits below the icon view were supposed to be aligned to the left
edge of the icon view, while in KDE3 the naming labels were aligned

However, in practice that never worked out perfectly, there was always a
small displacement. While hardly noticable in KDE4's widget styles, in
particular for Breeze in KF5 with its small splitter handle width and
larger layout spacing this became much more annoying to look at.

This can be fixed by taking the splitter handle width as well as the
grid layout spacing into account. While the patch seems straightforward,
making the patch work with all styles was actually suprisingly
difficult, not only because of the bug in the dependent patch.

Depends on D12592

Ref T8552

FIXED-IN: 5.46

Test Plan

kdialog --getopenfilename, check alignment with KMag for
different widget styles (e.g. Breeze, Oxygen, Windows and Fusion) after
startup, and after moving the splitter, resizing the dialog and toggling
the places panel.



Diff Detail

R241 KIO
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
rkflx created this revision.Apr 29 2018, 6:13 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 29 2018, 6:13 AM
rkflx requested review of this revision.Apr 29 2018, 6:13 AM
ngraham accepted this revision.Apr 29 2018, 10:30 PM
ngraham added a subscriber: ngraham.

Ah yes, this tiny discrepancy was so annoying. With this patch, alignment is also perfect when the Filter combobox turns into a dropdown menu button for many save dialogs.

Unrelatedly, "lafbox" reminds me of the circus.

This revision is now accepted and ready to land.Apr 29 2018, 10:30 PM
This revision was automatically updated to reflect the committed changes.