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.
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
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
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)
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.
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?
@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.
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
M +77 -16 ui/pageview.cpp
M +2 -0 ui/pageview.h