Fix padding of "Fit Width" button

Authored by rkflx on Oct 15 2017, 9:59 AM.



3e10699ac37c4 introduced "Fit to Width", but failed to adapt the width
calculation of the zoom mode buttons in the bottom zoom widget bar
accordingly. This resulted in the middle button getting its text cut off
for some languages, looking like this:

There are several options to remedy this:

  • Give equal width to all buttons
  • Give equal width to the outer buttons (i.e. symmetric, probably the initial intention when there were only two buttons)
  • Just respect the size hint of each button individually

As the three buttons are already quite wide, in order not to impact the
minimal window size too much (rules out "equal width") and at the same
time not to make the "Fit" button for English too narrow (rules out
"individual width") we choose the "symmetric" option.

BUG: 385035

Test Plan

Switch application language to Czech, view image. Text in "Fit to Width"
(i.e. middle) button not cut off anymore, minimal window size only
slightly impacted. For English, the "Fit" button is still wide enough.

Diff Detail

R260 Gwenview
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
rkflx created this revision.Oct 15 2017, 9:59 AM
broulik accepted this revision.Oct 15 2017, 12:37 PM
broulik added a subscriber: broulik.

This has annoyed me for quite some time :) I think the ability to *read* the buttons is more important than a unified width.

Do you have commit access?

This revision is now accepted and ready to land.Oct 15 2017, 12:37 PM

Thanks, will commit in the evening. I guess I could have committed this trivial patch directly, but you never know whether others have particular feelings about symmetry (see shadow discussion :)

Yeah, we'd rather do one review "too much" than one too little ;)

This revision was automatically updated to reflect the committed changes.