Bug 323435 - Zoom UI indicator shows more precision than the user cares about
Summary: Zoom UI indicator shows more precision than the user cares about
Alias: None
Product: okular
Classification: Unclassified
Component: general (show other bugs)
Version: 0.16.5
Platform: openSUSE RPMs Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: Okular developers
Keywords: junior-jobs
Depends on:
Reported: 2013-08-12 21:31 UTC by Richard Moore
Modified: 2014-05-05 22:48 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.14.0

Okular Zoom level (14.59 KB, image/png)
2013-08-25 15:23 UTC, tingnan.zhang
This attachment is a patch generated from the diff. (1.14 KB, patch)
2013-12-23 13:57 UTC, Harshil Lodhi

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Moore 2013-08-12 21:31:37 UTC
Do we really need 2 decimal places for the zoom UI? (I can understand the underlying implementation requiring them). I don't see that I care about 0.01% of the zoom enough for it to be displayed.

Reproducible: Always
Comment 1 Albert Astals Cid 2013-08-12 21:34:13 UTC
Yeah it's probably too much, see what other document viewers do UI wise and see if we can get some inspiration how to handle that
Comment 2 tingnan.zhang 2013-08-25 15:23:46 UTC
Created attachment 81922 [details]
Okular Zoom level

When the document is set to either "Fit Width" or "Fit Page" ,   then use "zoom in" or "zoom out" will get you a funny 2 decimal number
Comment 3 tingnan.zhang 2013-08-25 15:31:13 UTC
The behavior I believed is because, using zoom in and out  will result in a flat percentage change in the zoom level (10% when the zoom level is below 100%, 20% when the zoom level is between 100% and 200%, 50% when the zoom level is greater than 200%). On the other, the zoom level is generally not a integer when the page is fit to screen width or height. 

The behavior of Adobe Reader is to shift the zoom level to some predetermined value (like 1/3, 2/3, 100%, pageheight(suppose it is between 100% and 150%), 150%, etc)
Comment 4 Harshil Lodhi 2013-12-23 13:57:39 UTC
Created attachment 84246 [details]
This attachment is a patch generated from the diff.

This is my first time contributing to any opensource projects. Any suggestion from developers side would be encouraging. Do review it.
Comment 5 Albert Astals Cid 2013-12-23 14:14:27 UTC
Oh, you should have asked here or in the mailing list or in IRC before doing the patch, we have https://git.reviewboard.kde.org/r/112370/ in the review queue. Maybe you can lend a hand in the review and say what you think about the patch?
Comment 6 Harshil Lodhi 2013-12-23 14:24:20 UTC
@albert Thanks for the suggestion. From next time, I will first ask in comments. But atleast I learnt a lot of things by doing this patch. Looking forward to contribute to KDE.
Comment 7 Albert Astals Cid 2014-05-05 22:48:56 UTC
Git commit fad9c4e6fd532e0e80c019c6bc11b4c207d629db by Albert Astals Cid, on behalf of Tingnan Zhang.
Committed on 05/05/2014 at 22:43.
Pushed by aacid into branch 'master'.

Improvements to zoom behaviour

No need for double digit precision in the UI
ZoomIn/ZoomOut moves you through the well known steps + fit page, fit width; if you need any other you can always write it manually or use MMB zoom
Related: bug 323434
FIXED-IN: 4.14.0
REVIEW: 112370

M  +77   -16   ui/pageview.cpp
M  +2    -0    ui/pageview.h