[glade] GladeGtkScrolledWindow: fix add_verify()



commit 32e123859db0026b8de79b6245c3b329a5a1b6fb
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Wed Sep 30 20:06:13 2020 -0300

    GladeGtkScrolledWindow: fix add_verify()
    
    Respect user_feedback parameter in glade_gtk_scrolled_window_add_child_verify()

 plugins/gtk+/glade-gtk-scrolled-window.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-scrolled-window.c b/plugins/gtk+/glade-gtk-scrolled-window.c
index d0ea47be..ca3c6cab 100644
--- a/plugins/gtk+/glade-gtk-scrolled-window.c
+++ b/plugins/gtk+/glade-gtk-scrolled-window.c
@@ -66,10 +66,15 @@ glade_gtk_scrolled_window_add_child_verify (GladeWidgetAdaptor *adaptor,
                                             GtkWidget          *child,
                                             gboolean            user_feedback)
 {
-  GladeWidget *gcontainer = glade_widget_get_from_gobject (container);
-  GladeWidget *gchild = glade_widget_get_from_gobject (child);
+  if (user_feedback)
+    {
+      GladeWidget *gcontainer = glade_widget_get_from_gobject (container);
+      GladeWidget *gchild = glade_widget_get_from_gobject (child);
 
-  return !glade_util_check_and_warn_scrollable (gcontainer,
-                                                glade_widget_get_adaptor (gchild),
-                                                glade_app_get_window ());
+      return !glade_util_check_and_warn_scrollable (gcontainer,
+                                                    glade_widget_get_adaptor (gchild),
+                                                    glade_app_get_window ());
+    }
+  else
+    return GTK_IS_SCROLLED_WINDOW (container) && GTK_IS_SCROLLABLE (child);
 }


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