[Okular-devel] Patch for "best fit" zoom

Albert Astals Cid aacid at kde.org
Thu Jan 21 23:46:19 CET 2010


A Dilluns, 18 de gener de 2010, Thomas Fischer va escriure:
> Hello,
> 
> as a regular Okular user, I have an itch that I was scratching: I was
> looking for a zoom setting that is appropriate both for viewing
> presentations (in non-fullscreen mode) and text documents (portrait
> format).
> I came up with a "best fit" zoom level which corresponds to the existing
> "fit width" and "fit page" zoom levels.
> The best-fit setting compares the aspect ratios of the document and the
> viewing area it is shown in. If the aspect ratios nearly match, a page
> will be shown in "fit page" mode. This is useful e.g. for presentations,
> where a slide has a similar aspect ratio like the screen. If the aspect
> ratio is very different, such as in cases with portrait text documents,
> the document is scaled to "fit width" and you only have to scroll
> vertically. If the document is much wider, it is scaled to fit the
> height and you scroll horizontally only.
> 
> The attached patch introduces this feature while being just below 7k in
> size. Additionally, I removed/replaced some "fit text" zoom which seemed
> to be dead code. The patch is for KDE 4.3.4, but it should be no problem
> apply it to the upcoming 4.4 or trunk.

4.4 is frozen for new features since a lot of time ago, any new feature will 
be for 4.5

> 
> However, there is one major bug in my patch. If the ratio between aspect
> ratios is very close to switching between either of the three zooming
> modes, Okular may continuously switch between two modes. This seems to
> happen as Okular shows scrollbars if necessary, which change the view
> area's size (and this aspect), which in turn triggers the change in
> mode. As this new mode does not need scrollbars, they get disabled again
> and the circle closes. I have not yet found a nice and clean solution
> here.

AFAIK you can trigger thist without your patch too.

> 
> Comments are welcome.

Here it comes:
The code is isolated enough to guarantee that it will not affect the rest of 
the functionality, that is good.
On the other side i am not sure the functionality makes sense in general, so 
i'd like input from someone else stating they find the feature interesting 
(yes, asking your friends to say so is cheating ;-))

So anyone from the list would comment on the usefulness of the patch?

Albert

> 
> Bye,
> Thomas
> 


More information about the Okular-devel mailing list