[glade] Bug 759872 - Show popovers hidden by model buttons



commit f552f1e2dcd2761d8084ad8aefcfecd43c71156f
Author: Tristan Van Berkom <tristan vanberkom codethink co uk>
Date:   Fri Jan 29 11:01:33 2016 +0100

    Bug 759872 - Show popovers hidden by model buttons
    
    Model button enjoys hiding popover ancestors when clicked,
    just go ahead and re-show the hidden popovers in that case.

 plugins/gtk+/glade-gtk-model-button.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-model-button.c b/plugins/gtk+/glade-gtk-model-button.c
index c42216a..3b1a56b 100644
--- a/plugins/gtk+/glade-gtk-model-button.c
+++ b/plugins/gtk+/glade-gtk-model-button.c
@@ -5,11 +5,24 @@
 
 #include "glade-model-button-editor.h"
 
+static void
+model_button_clicked (GtkWidget *widget,
+                     gpointer   user_data)
+{
+  GtkWidget *popover;
+
+  popover = gtk_widget_get_ancestor (widget, GTK_TYPE_POPOVER);
+  if (popover != NULL)
+    gtk_widget_show (popover);
+}
+
 void
 glade_gtk_model_button_post_create (GladeWidgetAdaptor *adaptor,
-                                    GObject *container,
+                                    GObject *object,
                                     GladeCreateReason reason)
 {
+  g_signal_connect (object, "clicked",
+                   G_CALLBACK (model_button_clicked), NULL);
 }
 
 void


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