Zoom buttons out of sync sometimes
Open, Needs TriagePublic

Description

While testing D11336 there appeared some issues with the zoom buttons Fit, Fill and 100%.
Maybe there are more situations where this happens?

  • Click Fill or 100% button and middle-click on image ⇨ Fit button toggles, Fill/100% keeps pressed
  • Click 100% button and use zoom slider or Ctrl+Scroll100% keeps pressed
rkflx added a subscriber: rkflx.Mar 19 2018, 12:03 AM

Started to think about this, but then got really confused. I'm not even sure what state the buttons should have in every possible situation, i.e. what is a bug and what is a feature 🙄. The elephant in the room here is ConfigureImage ViewKeep same zoom and position, and this might also be related to D10897: Enlarge smaller images by default.

More specifically, is this displaying a locked zoom state, and/or should it be in sync with the zoom slider? This needs more pondering…

rkflx added a comment.EditedJul 13 2018, 3:21 PM
  • Click Fill or 100% button and middle-click on image ⇨ Fit button toggles, Fill/100% keeps pressed

Will be solved by D14093.

  • Click 100% button and use zoom slider or Ctrl+Scroll100% keeps pressed

I'd say this is a bug, and that button should switch back as soon as any other zoom action took place (just like Fit and Fill do).


In T8220#133312, @rkflx wrote:

More specifically, is this displaying a locked zoom state, and/or should it be in sync with the zoom slider? This needs more pondering…

Your idea (or rather re-discovery of an old feature…) in D14093 to allow toggling the button to off after a second press is really great and can solve the currently confusing behaviour nicely like so:

  • Only zero or one of the three buttons can be pressed at any time.
  • Pressing the button will perform the action, button keeps being pressed down.
  • Clicking again will undo the zooming action (or zoom to 100% if there is no previous zoom level) and unpress the button.

Furthermore:

  • Changing the zoom level by any other means will unpress all buttons.
  • The only exception to the previous point is when the minimum zoom level is reached, where Fit should auto-press (to allow zooming in and out with the mouse without having to constantly click on Fit before going to the next image). Note that this does not apply when Enlarge smaller images is enabled and the image is small enough.
  • Keep same zoom and position remembers and applies the currently active settings (either one of the buttons, or an actual zoom level if no button is pressed, i.e. a class with an enum with four states plus a float) when going to the next image.
rkflx added a comment.Jul 16 2018, 1:05 PM

Clicking again will undo the zooming action (or zoom to 100% if there is no previous zoom level) and unpress the button.

BTW, I just tested a KDE3 Gwenview, and there middle click toggles between the last zoom level and Fit, only since KDE4 Gwenview switches between Fit and 100%.