]> www.fi.muni.cz Git - evince.git/commitdiff
Don't make sidebar close button insensitive. Fixes bug #357871.
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>
Sun, 1 Oct 2006 10:50:42 +0000 (10:50 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sun, 1 Oct 2006 10:50:42 +0000 (10:50 +0000)
2006-10-01  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>

* shell/ev-sidebar.c: (ev_sidebar_init), (ev_sidebar_set_document):

Don't make sidebar close button insensitive. Fixes
bug #357871.

ChangeLog
shell/ev-sidebar.c

index cd8ca393c0b0f0ffe5a3fadfb1c5b06e70882d0b..d4d6ce10fb418b0387b829eb702559e98ab36770 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-01  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-sidebar.c: (ev_sidebar_init), (ev_sidebar_set_document):
+       
+       Don't make sidebar close button insensitive. Fixes
+       bug #357871.
+
 2006-10-01  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * shell/ev-window.c: (ev_window_setup_action_sensitivity),
index ca04157e34f6e6ec9149aeb095848ce21e0beac0..90e8c1daeb51366fe5cf382c1510fc71cb4462bc 100644 (file)
@@ -48,6 +48,7 @@ enum
 
 struct _EvSidebarPrivate {
        GtkWidget *notebook;
+       GtkWidget *select_button;
        GtkWidget *menu;
        GtkWidget *hbox;
        GtkWidget *label;
@@ -331,7 +332,6 @@ ev_sidebar_init (EvSidebar *ev_sidebar)
 {
        GtkWidget *hbox;
        GtkWidget *close_button;
-       GtkWidget *select_button;
        GtkWidget *select_hbox;
        GtkWidget *arrow;
        GtkWidget *image;
@@ -352,12 +352,12 @@ ev_sidebar_init (EvSidebar *ev_sidebar)
        gtk_box_pack_start (GTK_BOX (ev_sidebar), hbox, FALSE, FALSE, 0);
        gtk_widget_show (hbox);
 
-       select_button = gtk_toggle_button_new ();
-       gtk_button_set_relief (GTK_BUTTON (select_button), GTK_RELIEF_NONE);
-       g_signal_connect (select_button, "button_press_event",
+       ev_sidebar->priv->select_button = gtk_toggle_button_new ();
+       gtk_button_set_relief (GTK_BUTTON (ev_sidebar->priv->select_button), GTK_RELIEF_NONE);
+       g_signal_connect (ev_sidebar->priv->select_button, "button_press_event",
                          G_CALLBACK (ev_sidebar_select_button_press_cb),
                          ev_sidebar);
-       g_signal_connect (select_button, "key_press_event",
+       g_signal_connect (ev_sidebar->priv->select_button, "key_press_event",
                          G_CALLBACK (ev_sidebar_select_button_key_press_cb),
                          ev_sidebar);
 
@@ -373,11 +373,11 @@ ev_sidebar_init (EvSidebar *ev_sidebar)
        gtk_box_pack_end (GTK_BOX (select_hbox), arrow, FALSE, FALSE, 0);
        gtk_widget_show (arrow);
 
-       gtk_container_add (GTK_CONTAINER (select_button), select_hbox);
+       gtk_container_add (GTK_CONTAINER (ev_sidebar->priv->select_button), select_hbox);
        gtk_widget_show (select_hbox);
 
-       gtk_box_pack_start (GTK_BOX (hbox), select_button, TRUE, TRUE, 0);
-       gtk_widget_show (select_button);
+       gtk_box_pack_start (GTK_BOX (hbox), ev_sidebar->priv->select_button, TRUE, TRUE, 0);
+       gtk_widget_show (ev_sidebar->priv->select_button);
 
        close_button = gtk_button_new ();
        gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE);
@@ -396,7 +396,7 @@ ev_sidebar_init (EvSidebar *ev_sidebar)
        ev_sidebar->priv->menu = gtk_menu_new ();
        g_signal_connect (ev_sidebar->priv->menu, "deactivate",
                          G_CALLBACK (ev_sidebar_menu_deactivate_cb),
-                         select_button);
+                         ev_sidebar->priv->select_button);
        gtk_menu_attach_to_widget (GTK_MENU (ev_sidebar->priv->menu),
                                   GTK_WIDGET (ev_sidebar),
                                   ev_sidebar_menu_detach_cb);
@@ -409,7 +409,8 @@ ev_sidebar_init (EvSidebar *ev_sidebar)
                            TRUE, TRUE, 0);
        gtk_widget_show (ev_sidebar->priv->notebook);
 
-       gtk_widget_set_sensitive (GTK_WIDGET (ev_sidebar), FALSE);
+       gtk_widget_set_sensitive (GTK_WIDGET (ev_sidebar->priv->notebook), FALSE);
+       gtk_widget_set_sensitive (GTK_WIDGET (ev_sidebar->priv->select_button), FALSE);
 }
 
 /* Public functions */
@@ -515,7 +516,8 @@ ev_sidebar_set_document (EvSidebar   *sidebar,
        if (!has_pages) {
                gtk_widget_hide (GTK_WIDGET (sidebar));
        } else {
-               gtk_widget_set_sensitive (GTK_WIDGET (sidebar), TRUE);
+               gtk_widget_set_sensitive (GTK_WIDGET (sidebar->priv->notebook), TRUE);
+               gtk_widget_set_sensitive (GTK_WIDGET (sidebar->priv->select_button), TRUE);
        }
 }