[glade] GladeGtkWidget: special case GtkScrolledWindow remove parent action
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] GladeGtkWidget: special case GtkScrolledWindow remove parent action
- Date: Wed, 30 Sep 2020 23:08:00 +0000 (UTC)
commit e5b891d5cf32342ba32bb7cafdfb14815e22b5f0
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Wed Sep 30 20:06:01 2020 -0300
GladeGtkWidget: special case GtkScrolledWindow remove parent action
Make sure you can not remove parent if the grand parent is a scrolled window
and the child is not scrollable.
Fix issue #471 "XML not updated after adding element"
plugins/gtk+/glade-gtk-widget.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/plugins/gtk+/glade-gtk-widget.c b/plugins/gtk+/glade-gtk-widget.c
index ade2d22e..660a4144 100644
--- a/plugins/gtk+/glade-gtk-widget.c
+++ b/plugins/gtk+/glade-gtk-widget.c
@@ -705,7 +705,18 @@ widget_parent_changed (GtkWidget *widget,
parent = glade_widget_get_parent (gwidget);
if (parent && !glade_widget_get_internal (parent))
- glade_widget_set_action_sensitive (gwidget, "remove_parent", TRUE);
+ {
+ GladeWidget *grand_parent;
+ gboolean can_add = TRUE;
+
+ /* We can not use glade_widget_adaptor_add_verify() here because it takes into account placeholders
spaces */
+ if ((grand_parent = glade_widget_get_parent (parent)) &&
+ GTK_IS_SCROLLED_WINDOW (glade_widget_get_object (grand_parent)) &&
+ !GTK_IS_SCROLLABLE (widget))
+ can_add = FALSE;
+
+ glade_widget_set_action_sensitive (gwidget, "remove_parent", can_add);
+ }
else
glade_widget_set_action_sensitive (gwidget, "remove_parent", FALSE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]