]> www.fi.muni.cz Git - evince.git/commitdiff
A bit different fix for rounding problem but it has no
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sat, 4 Jun 2005 22:53:48 +0000 (22:53 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sat, 4 Jun 2005 22:53:48 +0000 (22:53 +0000)
problems on startup. Make properties window transient to parent.

ChangeLog
shell/ev-view.c
shell/ev-window.c

index 4a82452b3e1a86816af36d87e58bdc0034a8937c..361687ee2cd9758f9ac5ef48721a6ef4931a796a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-06-05  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-view.c: (view_set_adjustment_values):
+       * shell/ev-window.c: (ev_window_cmd_file_properties):
+       
+       A bit different fix for rounding problem but it has no
+       problems on startup. Make properties window transient to parent.
+
 2005-06-04  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * pdf/ev-poppler.cc:
index 20c0eefd5b30cc525e91b053c3174c9e0dedbd40..4ea0fce268ad555d6e3e330a46f9cc88d594dffc 100644 (file)
@@ -422,16 +422,14 @@ view_set_adjustment_values (EvView         *view,
                return;
        
        factor = 1.0;
-       /* We add 0.5 to the values before to average out our rounding errors.
-        */
        switch (view->pending_scroll) {
                case SCROLL_TO_KEEP_POSITION: 
-                       factor = (adjustment->value + 0.5) / adjustment->upper;
+                       factor = (adjustment->value) / adjustment->upper;
                        break;
                case SCROLL_TO_CURRENT_PAGE: 
                        break;
                case SCROLL_TO_CENTER: 
-                       factor = (adjustment->value + adjustment->page_size * 0.5 + 0.5) / adjustment->upper;
+                       factor = (adjustment->value + adjustment->page_size * 0.5) / adjustment->upper;
                        break;
        }
 
@@ -441,16 +439,19 @@ view_set_adjustment_values (EvView         *view,
        adjustment->lower = 0;
        adjustment->upper = MAX (allocation, requisition);
 
+       /* 
+        * We add 0.5 to the values before to average out our rounding errors.
+        */
        switch (view->pending_scroll) {
                case SCROLL_TO_KEEP_POSITION: 
-                       new_value = CLAMP (adjustment->upper * factor, 0, adjustment->upper - adjustment->page_size);
+                       new_value = CLAMP (adjustment->upper * factor + 0.5, 0, adjustment->upper - adjustment->page_size);
                        gtk_adjustment_set_value (adjustment, (int)new_value);
                        break;
                case SCROLL_TO_CURRENT_PAGE: 
                        scroll_to_current_page (view, orientation);
                        break;
                case SCROLL_TO_CENTER: 
-                       new_value = CLAMP (adjustment->upper * factor - adjustment->page_size * 0.5,
+                       new_value = CLAMP (adjustment->upper * factor - adjustment->page_size * 0.5 + 0.5,
                                           0, adjustment->upper - adjustment->page_size);
                        gtk_adjustment_set_value (adjustment, (int)new_value);
                        break;
index 2404001ef4862262c01bbb05543b5798619943ee..aeceba8cf087962977f033dcb1812f6267567b4d 100644 (file)
@@ -1202,6 +1202,7 @@ ev_window_cmd_file_properties (GtkAction *action, EvWindow *ev_window)
 
        info = ev_document_get_info (document);
        dialog = ev_properties_new (info, fonts);
+       gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW(window));
        gtk_dialog_run (dialog);
        gtk_widget_destroy (GTK_WIDGET (dialog));
        ev_document_info_free (info);