Center numbers in Crop and Reduce Red Eye spinboxes
ClosedPublic

Authored by rkflx on Aug 20 2018, 4:39 PM.

Details

Summary

When increasing the value displayed in a spinbox, normally the least
significant digit should stay in place to avoid unecessary movement.
This means the numbers should be right-aligned, instead of being
left-aligned like they are currently.

Since right-aligning still looks a bit unbalanced, centering should be a
good middle ground. In addition, when the number of digits does not
change it makes more sense to pad the number on both sides equally in
any case.

Test Plan

Check that the spinboxes in the Crop and Reduce Red Eye
tools look more pleasant while resizing the crop rectangle and moving
the size slider respectively. For a more profound effect, use a large
image.

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 20 2018, 4:39 PM
rkflx created this revision.
rkflx added a comment.Aug 20 2018, 4:40 PM

Keyboard handling solved as requested and tests are running again, so now I can get back to what I was actually working on ;)

Besides centering the numbers, I had one more idea: Add spaces to the CropAspect ratio combobox preview text, so it would read "Width : Height" instead of "Width:Height" (I don't want to touch "1:2" etc.). Any objections? (Patch is trivial again, mainly asking for whether the change makes sense.)

The centered layout looks good to me, slightly better than right aligned.

Besides centering the numbers, I had one more idea: Add spaces to the CropAspect ratio combobox preview text, so it would read "Width : Height" instead of "Width:Height" (I don't want to touch "1:2" etc.). Any objections? (Patch is trivial again, mainly asking for whether the change makes sense.)

No objections from me, IMO this would improve readability.


Btw. there seems to be an initialization problem with the config value CropRatioIndex. If you open and close Crop without selecting a ratio, CropRatioIndex stores random values which sometimes (rarely) results in a preselected ratio which you had never selected.
I'll take a look at it, should be easy to fix.

Restricted Application added a project: Gwenview. · View Herald TranscriptAug 21 2018, 7:59 AM
muhlenpfordt accepted this revision.Aug 22 2018, 7:14 AM
This revision is now accepted and ready to land.Aug 22 2018, 7:14 AM
This revision was automatically updated to reflect the committed changes.