[gnome-builder] view-stack: use gtk_widget_hide() to hide views popover



commit f36c43723f401007f42e19b3a714ca694a5dd7be
Author: Christian Hergert <christian hergert me>
Date:   Mon Jun 15 14:29:03 2015 -0700

    view-stack: use gtk_widget_hide() to hide views popover
    
    set_active() is not reliable, and no longer works with recent gtk releases.
    So instead, just hide the popover directly.

 src/views/gb-view-stack-private.h |    1 +
 src/views/gb-view-stack.c         |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/views/gb-view-stack-private.h b/src/views/gb-view-stack-private.h
index 4d34a7e..349642a 100644
--- a/src/views/gb-view-stack-private.h
+++ b/src/views/gb-view-stack-private.h
@@ -49,6 +49,7 @@ struct _GbViewStack
   GtkLabel           *title_label;
   GtkListBox         *views_button;
   GtkListBox         *views_listbox;
+  GtkPopover         *views_popover;
 
   guint               destroyed : 1;
   guint               focused : 1;
diff --git a/src/views/gb-view-stack.c b/src/views/gb-view-stack.c
index 540b546..c7bb48d 100644
--- a/src/views/gb-view-stack.c
+++ b/src/views/gb-view-stack.c
@@ -392,7 +392,7 @@ gb_view_stack__views_listbox_row_activated_cb (GbViewStack   *self,
 
   if (GB_IS_VIEW (view))
     {
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->views_button), FALSE);
+      gtk_widget_hide (GTK_WIDGET (self->views_popover));
       gb_view_stack_set_active_view (self, GTK_WIDGET (view));
       gtk_widget_grab_focus (GTK_WIDGET (view));
     }
@@ -535,6 +535,7 @@ gb_view_stack_class_init (GbViewStackClass *klass)
   GB_WIDGET_CLASS_BIND (klass, GbViewStack, title_label);
   GB_WIDGET_CLASS_BIND (klass, GbViewStack, views_button);
   GB_WIDGET_CLASS_BIND (klass, GbViewStack, views_listbox);
+  GB_WIDGET_CLASS_BIND (klass, GbViewStack, views_popover);
 }
 
 static void


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