Bug 396360 - Shortcut F does not toggle between original size and fit to window any more
Summary: Shortcut F does not toggle between original size and fit to window any more
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 17.12.3
Platform: unspecified Linux
: NOR minor
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-10 09:59 UTC by cs
Modified: 2018-07-16 22:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cs 2018-07-10 09:59:00 UTC
In previous versions of Gwenview, when viewing a picture it was possible to toggle between 100% size and fit mode using the "F" shortcut. In Gwenview 17.12 (Opensuse Leap 15, Kubuntu 18.04) this is not possible any more, the "F" shortcut only switches to Fit mode and fails to switch back to original size.

In the documentation this feature is still mentioned: "Einpassen vergrößert das aktuelle Bild auf die Größe des Anzeigefensters und 100 % zeigt das Bild in voller Pixelgröße. Mit dem Kurzbefehl F können Sie zwischen diesen Vergrößerungsmodi wechseln."

I tried to restore this feature using the menu entry "Settings" -> "Configure shortcuts" but there I did not find a possibility to configure the shortcut to toggle between two modes.

I loved this feature very much. I have been using it a lot and I am really missing it.

Please restore this toggle shortcut!
Comment 1 null 2018-07-10 20:39:08 UTC
Thanks for the report, I can confirm the issue. As a workaround, you can middle click to toggle between Fit and 100%.

Bisecting shows that this has been broken by https://phabricator.kde.org/R260:3e10699ac37c4b8ffc510546913e26fb9f89aa6c, i.e. since Gwenview 17.08.0.
Comment 2 Peter Mühlenpfordt 2018-07-11 10:26:22 UTC
There are three zoom buttons by now. The documentation at https://docs.kde.org/trunk5/en/kdegraphics/gwenview/view_mode.html was updated to: "The shortcut F switches to fit mode." (Btw. - we should update the screenshot here).
Should we really toggle between two of the zoom presets with one shortcut or better add shortcuts for the other two? For "Fill" Qt::Key_W is prepared but commented out.
Comment 3 null 2018-07-11 18:41:40 UTC
At least commits shouldn't break people's existing workflows ;)

We could provide default shortcuts for every mode (Fit/Fill/100%), but switching back and forth is much quicker when you don't have to hunt for another key and can simply toggle the same shortcut.

How about doing both:
- "=" for 100%, Ctrl++ and Ctrl+- for Zoom In/Out (like in Firefox)
- "F" for Fit (zoom to 100% if already zoomed to fit)
- "Shift+F" for Fill (zoom to 100% if already zoomed to fill)

And for middle-clicking, it could work like this (to be added to the docbook):
- Middle-click: Toggle between Fit and 100%
- Shift + middle-click: Toggle between Fill and 100%
Comment 4 cs 2018-07-13 08:53:38 UTC
(In reply to Henrik Fehlauer from comment #3)
> - "=" for 100%, Ctrl++ and Ctrl+- for Zoom In/Out (like in Firefox)
> - "F" for Fit (zoom to 100% if already zoomed to fit)
> - "Shift+F" for Fill (zoom to 100% if already zoomed to fill)

+1. Sounds very good!
Comment 5 Peter Mühlenpfordt 2018-07-13 09:10:57 UTC
Yes, I like it this way too. :)

Created two diffs for it:
https://phabricator.kde.org/D14093
https://phabricator.kde.org/D14094
Comment 6 Peter Mühlenpfordt 2018-07-16 07:38:09 UTC
Git commit 9b898af627ab46a9de5486470f488af10aaa8e87 by Peter Mühlenpfordt.
Committed on 16/07/2018 at 07:36.
Pushed by muhlenpfordt into branch 'master'.

Add shortcut Shift+F for zoom option "Fill"

Summary:
This patch adds the shortcut {key Shift F} for zoom option {nav Fill}.

Test Plan:
# Open Gwenview in View Mode
# Use {key Shift F} to switch to {nav Fill} zoom factor

Reviewers: #gwenview, rkflx

Reviewed By: #gwenview, rkflx

Subscribers: rkflx

Differential Revision: https://phabricator.kde.org/D14094

M  +1    -1    lib/documentview/documentviewcontroller.cpp

https://commits.kde.org/gwenview/9b898af627ab46a9de5486470f488af10aaa8e87
Comment 7 Peter Mühlenpfordt 2018-07-16 15:19:23 UTC
Git commit 945c8a7a8d0b8326b194d44ec004963c0694f49a by Peter Mühlenpfordt.
Committed on 16/07/2018 at 15:15.
Pushed by muhlenpfordt into branch 'master'.

Toggle between zoom options "Fit"/"Fill" and "100%" on multiple activation

Summary:
In previous versions of Gwenview it was possible to toggle between
{nav Fit} and {nav 100%} zoom factors using the shortcut {key F}.
After 3e10699ac37c added the {nav Fit Width} zoom option this feature
did not work any more.
This patch adds toggling for both {nav Fit} and {nav Fill} zoom
options if the shortcut {key F} or one of the buttons is pressed
multiple times. Zooming to 100% is centered to the current cursor
position like middle click works.

Test Plan:
# Open Gwenview in View Mode
# Use zoom buttons {nav Fit}/{nav Fill} or {key F} multiple times
# The zoom should toggle between {nav Fit} and {nav 100%},
  respectively between {nav Fill} and {nav 100%}

Reviewers: #gwenview, rkflx

Reviewed By: #gwenview, rkflx

Subscribers: rkflx

Differential Revision: https://phabricator.kde.org/D14093

M  +2    -0    lib/documentview/abstractimageview.cpp
M  +30   -0    lib/documentview/documentview.cpp
M  +2    -0    lib/documentview/documentview.h
M  +2    -7    lib/documentview/documentviewcontroller.cpp

https://commits.kde.org/gwenview/945c8a7a8d0b8326b194d44ec004963c0694f49a
Comment 8 null 2018-07-16 22:11:59 UTC
Git commit 11ed44cdf988db2a055265afc76f6b7c8be64fb6 by Henrik Fehlauer.
Committed on 16/07/2018 at 22:11.
Pushed by rkflx into branch 'Applications/18.08'.

Add mouse shortcut for Fill and adapt docbook

Summary:
D14093 will add back middle-clicking to toggle between {nav Fit} (with
{key F} as its keyboard shortcut) and {nav 100%} zoom. In addition,
D14094 sets {key Shift F} as a shortcut for {nav Fill}.

Going along with this, here we add {key Shift}-middle-clicking for
{nav Fill}. The code is moved to `DocumentView` in order not to
duplicate the handling of the toggling behaviour.

We also adapt the docbook accordingly, as some users still seem to read
the manual.

Depends on D14093

Test Plan:
Middle-click multiple times on an image in {nav View} mode and observe
{nav Fit} is toggled. Repeat while holding down {key Shift} for
{nav Fill}.
Proof-read docbook ("View mode" and "Tips" sections).

Reviewers: #gwenview, muhlenpfordt

Reviewed By: #gwenview, muhlenpfordt

Subscribers: muhlenpfordt, kde-doc-english

Tags: #documentation

Differential Revision: https://phabricator.kde.org/D14103

M  +3    -4    doc/index.docbook
M  +0    -8    lib/documentview/abstractimageview.cpp
M  +13   -0    lib/documentview/documentview.cpp
M  +1    -0    lib/documentview/documentview.h

https://commits.kde.org/gwenview/11ed44cdf988db2a055265afc76f6b7c8be64fb6