[cheese/netbook-mode] thumbnav: correctly update up-down button sensitiveness



commit 3bdd4e91030a83ddb771b1565fa5310856a8d07e
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Sun Aug 9 12:40:05 2009 +0200

    thumbnav: correctly update up-down button sensitiveness
    
    Force an update on up and down button sensitiveness while swithching
    mode. Fix vadj "changed" handler.

 src/eog-thumb-nav.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/eog-thumb-nav.c b/src/eog-thumb-nav.c
index 38fd314..ff3d67a 100644
--- a/src/eog-thumb-nav.c
+++ b/src/eog-thumb-nav.c
@@ -123,7 +123,9 @@ eog_thumb_nav_vadj_changed (GtkAdjustment *vadj, gpointer user_data)
                 "page_size", &page_size,
                 NULL);
 
-  gtk_widget_set_sensitive (ltr ? priv->button_right : priv->button_left,
+  gtk_widget_set_sensitive (priv->button_up, value > 0);
+
+  gtk_widget_set_sensitive (priv->button_down,
                             value < upper - page_size);
 }
 
@@ -686,6 +688,7 @@ eog_thumb_nav_set_vertical (EogThumbNav *nav, gboolean vertical)
     gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw),
                                     GTK_POLICY_NEVER,
                                     GTK_POLICY_AUTOMATIC);
+    gtk_adjustment_value_changed (priv->vadj);
     priv->vertical = TRUE;
   } else {
     g_print ("setting horizontal mode\n");
@@ -707,6 +710,7 @@ eog_thumb_nav_set_vertical (EogThumbNav *nav, gboolean vertical)
     gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw),
                                     GTK_POLICY_AUTOMATIC,
                                     GTK_POLICY_NEVER);
+    gtk_adjustment_value_changed (priv->hadj);
     priv->vertical = FALSE;
   }
   gtk_widget_show_all (GTK_WIDGET (nav));



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