[glade/glade-3-38] GladeGtkWidget: add viewport on add scrolled window action
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/glade-3-38] GladeGtkWidget: add viewport on add scrolled window action
- Date: Fri, 2 Oct 2020 19:30:15 +0000 (UTC)
commit 362e95362da647a1c54e5eeb2ecabc03048e8f53
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Wed Sep 16 20:11:10 2020 -0300
GladeGtkWidget: add viewport on add scrolled window action
Add a viewport for non scrollable widget when adding a
scrolled window parent.
Fix issue #471 "XML not updated after adding element"
plugins/gtk+/glade-gtk-widget.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/plugins/gtk+/glade-gtk-widget.c b/plugins/gtk+/glade-gtk-widget.c
index 6061d8b9..e5ab6de6 100644
--- a/plugins/gtk+/glade-gtk-widget.c
+++ b/plugins/gtk+/glade-gtk-widget.c
@@ -932,6 +932,18 @@ glade_gtk_widget_action_activate (GladeWidgetAdaptor *adaptor,
if ((gnew_parent =
glade_command_create (adaptor, gparent, NULL, project)) != NULL)
{
+ /* We might need to add a viewport */
+ if (new_type == GTK_TYPE_SCROLLED_WINDOW &&
+ !GTK_IS_SCROLLABLE (object))
+ {
+ GladeWidgetAdaptor *viewport =
+ glade_widget_adaptor_get_by_type (GTK_TYPE_VIEWPORT);
+ gnew_parent = glade_command_create (viewport,
+ gnew_parent,
+ NULL,
+ project);
+ }
+
/* Now we created the new parent, if gwidget had a parentless widget reference...
* set that reference to the new parent instead */
if (property)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]