[glade/tintou/listbox-placeholder: 6/6] Remove added widgets if placeholder is disabled
- From: Alberto Fanjul <albfan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/tintou/listbox-placeholder: 6/6] Remove added widgets if placeholder is disabled
- Date: Tue, 6 Aug 2019 10:15:02 +0000 (UTC)
commit 5f4207537dd999e92a22ae744e3cfa20cc92fab4
Author: Alberto Fanjul <albertofanjul gmail com>
Date: Tue Aug 6 12:13:17 2019 +0200
Remove added widgets if placeholder is disabled
plugins/gtk+/glade-gtk-list-box.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/plugins/gtk+/glade-gtk-list-box.c b/plugins/gtk+/glade-gtk-list-box.c
index 79feb7bb..fb90a968 100644
--- a/plugins/gtk+/glade-gtk-list-box.c
+++ b/plugins/gtk+/glade-gtk-list-box.c
@@ -225,7 +225,20 @@ glade_gtk_listbox_set_property (GladeWidgetAdaptor *adaptor,
g_object_set_data (G_OBJECT (child), "special-child-type", "placeholder");
}
else
- child = NULL;
+ {
+ child = glade_listbox_get_placeholder (GTK_LIST_BOX (object));
+ if (child)
+ {
+ GladeProject *project = glade_widget_get_project (glade_widget_get_from_gobject (object));
+ /* Assign selection first */
+ if (glade_project_is_selected
+ (project, child) == FALSE)
+ glade_project_selection_set (project, child, FALSE);
+
+ glade_project_command_delete (project);
+ }
+ child = NULL;
+ }
gtk_list_box_set_placeholder (GTK_LIST_BOX (object), child);
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]