proposal for better default sizing



I really like the new feature of reusing the last document settings
for new documents. I am one of those people who hate
continuous scrolling (I don't move a book up & down when reading it.)
and this allows me to switch it off once and for ever.

But why didn't you activate this feature also for the size
of the evince window?  At least as long as no better algorithm
for the initial evince window size is implemented, I suggest

--- ev-window.c.orig    2006-03-07 17:20:38.000000000 +0100
+++ ev-window.c 2006-03-07 18:06:27.000000000 +0100
@@ -722,8 +722,8 @@
        }

        if (restore_size &&
-           ev_metadata_manager_get (uri, "window_width", &width, TRUE) &&
-            ev_metadata_manager_get (uri, "window_height", &height, TRUE)) {
+           ev_metadata_manager_get (uri, "window_width", &width, FALSE) &&
+            ev_metadata_manager_get (uri, "window_height", &height, FALSE)) {
                gtk_window_resize (GTK_WINDOW (window),
                                   g_value_get_int (&width),
                                   g_value_get_int (&height));


(the patches are w.r.t. version 0.5.1)


Another point: since I have a big and wide screen I like to use the
dual mode of evince. But with new documents it may happen that they are
already in landscape format. So I propose a redefinition of "best fit" mode
(or the introduction of an "even better fit" mode):
The patch at the end gives the following behaviour in "best fit" mode:
Dual mode gets activated if the evince window has "landscape" form and the
document has "portrait" form and it gets deactivated otherwise.

If you now look at a document in "portrait" form with "best fit" mode and
take the mouse and pull your evince window wider or narrower,
it switches between dual and non-dual mode. That is exactly the behaviour
I like. Any chances for adopting it?

Best wishes, Meik


--- ev-view.c.orig      2006-03-08 15:02:44.000000000 +0100
+++ ev-view.c   2006-03-08 15:55:33.000000000 +0100
@@ -3237,6 +3237,30 @@
                ev_view_zoom_for_size_continuous_and_dual_page (view, width, height, vsb_width, hsb_height);
        else if (view->continuous)
                ev_view_zoom_for_size_continuous (view, width, height, vsb_width, hsb_height);
+       else if (view->sizing_mode == EV_SIZING_BEST_FIT) {
+               int doc_width, doc_height;
+
+               ev_page_cache_get_size (view->page_cache,
+                                       view->current_page,
+                                       view->rotation,
+                                       1.0,
+                                       &doc_width,
+                                       &doc_height);
+               if(doc_width > doc_height) {
+                       /* doc in landscape form -> no dual view */
+                       ev_view_set_dual_page(view, FALSE);
+                       ev_view_zoom_for_size_single_page (view, width, height,vsb_width, hsb_height);
+               } else {
+                       if(width > height) {
+                               /* ok, dual fits better */
+                               ev_view_set_dual_page(view, TRUE);
+                               ev_view_zoom_for_size_dual_page (view, width, height, vsb_width, hsb_height);
+                       } else {
+                               ev_view_set_dual_page(view, FALSE);
+                               ev_view_zoom_for_size_single_page (view, width,
height, vsb_width, hsb_height);
+                       }
+               }
+       }
        else if (view->dual_page)
                ev_view_zoom_for_size_dual_page (view, width, height, vsb_width, hsb_height);
        else





-- 
Meik Hellmund
Institut fuer Mathematik, Uni Leipzig
e-mail: Meik Hellmund math uni-leipzig de
http://www.math.uni-leipzig.de/~hellmund



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]