Keep the width of the crop spinboxes fixed to avoid wiggling
ClosedPublic

Authored by rkflx on Aug 16 2018, 7:59 PM.

Details

Summary

When moving the Crop handles with the mouse, the UI of the bottom
toolbar jumps around which does not look very professional.

This is due to Qt adapting the width of the spinboxes to their maximum
value (so numbers with more digits still fit without being cut off),
which obviously changes depending on what the user selected to crop. For
example, initially the crop size is equal to the image size, so the
maximum displacement is 0 in both directions. Making the crop rectangle
smaller will subsequently increase the number of digits needed in the
position spinboxes.

The issue can be fixed by setting the minimum width to the maximum width
possible during initialization instead of increasing it dynamically via
Qt, effectively enforcing a fixed size.

FIXED-IN: 18.08.1

Test Plan

Activate Crop and check Advanced Settings. Moving the
top-left crop handle to the bottom-right should not result in any
movement in the UI of the crop toolbar anymore, since the spinboxes are
now fixed in width.

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rkflx requested review of this revision.Aug 16 2018, 7:59 PM
rkflx created this revision.
rkflx added a comment.Aug 16 2018, 7:59 PM

Sounds simple once you know the trick, but to get there was a bit long-winded…


I have two more patches almost ready for Crop (center numbers, adjust spacing), but there is another issue I noticed but have not looked into yet (in case you are interested in investigating): Invoking Crop when Advanced Settings was checked before will correctly make the window wider to fit the toolbar. However, invoking Crop and enabling Advanced Settings only afterwards won't do the same, it cuts off the toolbar.

muhlenpfordt accepted this revision.Aug 17 2018, 10:09 AM

Sounds simple once you know the trick, but to get there was a bit long-winded…

Nice trick, works good. After finding it's magically obvious. ;)


I have two more patches almost ready for Crop (center numbers, adjust spacing),

Just go on. I'll look at them.

but there is another issue I noticed but have not looked into yet (in case you are interested in investigating): Invoking Crop when Advanced Settings was checked before will correctly make the window wider to fit the toolbar. However, invoking Crop and enabling Advanced Settings only afterwards won't do the same, it cuts off the toolbar.

That's strange, maybe another missing layout issue.
Ok, a job for me. ;)

This revision is now accepted and ready to land.Aug 17 2018, 10:09 AM
This revision was automatically updated to reflect the committed changes.