Bug 400048 - [Polish] Add shortcut to display the document 100%
Summary: [Polish] Add shortcut to display the document 100%
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.5.1
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: junior-jobs, usability
: 210850 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-10-20 00:07 UTC by Varaskkar
Modified: 2019-01-29 14:52 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 18.12.0


Attachments
keyboard shortcut menu options (24.66 KB, image/png)
2018-10-20 00:07 UTC, Varaskkar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Varaskkar 2018-10-20 00:07:29 UTC
Created attachment 115758 [details]
keyboard shortcut menu options

I have a screen 1366x768 and to see a document, I need always to click on the UI to view the document 100%. It would be quite useful to add a shortcut to activate it from the keyboard.
Comment 1 Albert Astals Cid 2018-10-20 08:56:33 UTC
Maybe what you want is just setting the default open mode to be 100% instead of Zoom to page width?
Comment 2 Varaskkar 2018-10-20 15:21:29 UTC
Yes Albert, really that would be an even better solution. 

Even if it was possible to add both options because when you zoom with the shortcut keyboard, you could return to 100% display also with another shortcut.
Comment 3 Albert Astals Cid 2018-10-20 21:09:09 UTC
> really that would be an even better solution. 

You can already do this now.
Comment 4 Nate Graham 2018-10-20 21:31:44 UTC
Indeed: Settings > Configure Okular > General > Default Zoom > set to 100%.

I do agree that there should be a "Zoom to 100%" menu item with a keyboard shortcut, though. It's pretty much the only common zoom setting that's missing from the View menu.
Comment 5 Nate Graham 2018-10-20 21:34:33 UTC
A KStandardAction was recently added for this (including a keyboard shortcut!) in Bug 305702, so in principle it shouldn't be that hard to get it into Okular.

I'll see if I can figure out how!
Comment 6 Varaskkar 2018-10-20 21:35:58 UTC
It's true, although I had not noticed because when I zoom and, close and open Okular, the document is seen with the zoom because I left it activated before closing the application. It's like Okular saves the last mode the document was viewed in. 

Even so, if it were possible to add the keyboard shortcut I think it would help in these cases.
Comment 7 Nate Graham 2018-10-20 21:42:10 UTC
(In reply to Varaskkar from comment #6)
> It's like Okular saves the last mode the document was viewed in. 
Yep, that's exactly what it does. :)
Comment 8 Nate Graham 2018-10-21 04:09:24 UTC
Here, have a patch! It wasn't too hard to put together after all.

https://phabricator.kde.org/D16345
Comment 9 Nate Graham 2018-10-27 14:50:02 UTC
Git commit 33ca396def24d0be862ef8a132837cfcd1320733 by Nate Graham.
Committed on 27/10/2018 at 14:49.
Pushed by ngraham into branch 'master'.

Create new "Zoom to 100%" action

Summary:
This patch implements a "Zoom to 100%" action and sticks it in the {nav View} menu. Since it's a `KStandardAction` with a `KStandardShortcut`, we automatically get the correct icon and keyboard shortcut, but we do override the name to be "Zoom to 100%" since that's clearer for Okular's use case.
FIXED-IN: 18.12.0

Test Plan:
- Action works to zoom the document to 100% scale when invoked
- Action is disabled when document is opened at 100% scale or is manually zoomed to 100% scale after being opened
- All other zoom modes and action still work

{F6341045}

Reviewers: #okular, #vdg, abetts

Reviewed By: #vdg, abetts

Subscribers: davidhurka, sander, tobiasdeiminger, veqz, abetts, aacid, okular-devel

Tags: #okular

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

M  +2    -1    part-viewermode.rc
M  +2    -1    part.rc
M  +16   -0    ui/pageview.cpp
M  +3    -2    ui/pageview.h

https://commits.kde.org/okular/33ca396def24d0be862ef8a132837cfcd1320733
Comment 10 Varaskkar 2018-10-27 21:55:50 UTC
I'm glad to read that this feature will be part of Okular, I won't have that problem anymore, thank you guys for the help and thank you Nate for implementing it =)
Comment 11 Nate Graham 2018-10-28 03:29:01 UTC
You're very welcome!
Comment 12 Albert Astals Cid 2019-01-29 14:52:30 UTC
*** Bug 210850 has been marked as a duplicate of this bug. ***