Here is a proposal for an improvement on the great patch "PDF Preview in SplitView - ID: 2799221" by Dan Mihai Ile.
The differences with and additions to the above mentioned patch are:
- the ability to zoom in or out in the pdf preview, with the aid of two buttons in the toolbar
- the preview width and zoom factor are automatically saved in the preferences
- when resizing the window, the preview keeps the same size, and the editor is resized (it was the contrary before)
- the handling of the initial width of the preview uses now the "set_size_request" method (no need for the "gobject.timeout_add(10, self.adjust_width)")
- the document is initially shown centered horizontally, even if it is larger than the preview panel
- when the document is zoomed in or out, the top of the current view stays at the top after the zoom
- when the preview panel is resized, the (horizontal) center of the current view remains at the center, instead of keeping the left border at the same place
- the border of each page is drawn without antialiasing, so that it looks sharper
- a shadow is drawn under each page
The reason for all these horizontal centerings is that on small screens, users may not want to display the whole width of the pages, but only the part where there is text, hiding thus the margins. The above features aim at simplifying this procedure.
The buttons used to zoom in and out should ideally be hidden when the preview is not active, but I don't know how to do this (probably not because it's difficult, but only because I'm ignorant).
I also tried to add accelerators for these buttons (naively copying what is done for menu items), but I did not succeed.
And finally it would be nice if there could be accelerators to scroll the preview without using the mouse (which is, I think, the only way to do it now), but here again, I don't know how to do it.
The attached patches are against revision 340 in svn. Place them in the src subdirectory, and type
patch base/config.py base_config.py.patch
patch latex/actions.py latex_actions.py.patch
patch latex/editor.py latex_editor.py.patch
patch latex/livepreview.py latex_livepreview.py.patch
(not really the svn way, sorry)
Log in to post a comment.