[glade] * gladeui/glade-project.[ch]: added accessor for toplevel list
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] * gladeui/glade-project.[ch]: added accessor for toplevel list
- Date: Wed, 2 Feb 2011 23:46:36 +0000 (UTC)
commit c2c091a665841f64b9b288c8b947e058040f0127
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Wed Feb 2 20:44:07 2011 -0300
* gladeui/glade-project.[ch]: added accessor for toplevel list
* gladeui/glade-design-view.c: pack toplevel widgets in GladeProject toplevels list order.
* gladeui/glade-property.c: added special case for parentless widget properties
on glade_property_set_value_impl() to show and hide new and old values.
* gladeui/glade-editor-property.c: removed glade_widget_hide() call on
glade_eprop_object_show_dialog() since now its handled on GladeProperty
ChangeLog | 12 +++++++++++-
gladeui/glade-design-view.c | 5 +++++
gladeui/glade-editor-property.c | 2 --
gladeui/glade-project.c | 14 ++++++++++++++
gladeui/glade-project.h | 2 ++
gladeui/glade-property.c | 15 +++++++++++++++
6 files changed, 47 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c45e87f..082f463 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,7 +5,17 @@
on widget where gtk_widget_get_preferred_height() value is different than
the one returned by gtk_widget_get_preferred_size()
- * gladeui/glade-design-view.c: set layout halign property to GTK_ALIGN_START
+ * gladeui/glade-design-view.c:
+ o set layout halign property to GTK_ALIGN_START
+ o pack toplevel widgets in GladeProject toplevels list order.
+
+ * gladeui/glade-project.[ch]: added accessor for toplevel list
+
+ * gladeui/glade-property.c: added special case for parentless widget properties
+ on glade_property_set_value_impl() to show and hide new and old values.
+
+ * gladeui/glade-editor-property.c: removed glade_widget_hide() call on
+ glade_eprop_object_show_dialog() since now its handled on GladeProperty
2011-02-01 Juan Pablo Ugarte <juanpablougarte gmail com>
diff --git a/gladeui/glade-design-view.c b/gladeui/glade-design-view.c
index 1dc433a..491bee4 100644
--- a/gladeui/glade-design-view.c
+++ b/gladeui/glade-design-view.c
@@ -170,6 +170,7 @@ static void
glade_design_view_add_toplevel (GladeDesignView *view, GladeWidget *widget)
{
GtkWidget *layout;
+ GList *toplevels;
GObject *object;
if (glade_widget_get_parent (widget) ||
@@ -183,6 +184,10 @@ glade_design_view_add_toplevel (GladeDesignView *view, GladeWidget *widget)
gtk_widget_set_halign (layout, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (view->priv->layout_box), layout, FALSE, FALSE, 0);
+ if ((toplevels = glade_project_toplevels (view->priv->project)))
+ gtk_box_reorder_child (GTK_BOX (view->priv->layout_box), layout,
+ g_list_index (toplevels, GTK_WIDGET (object)));
+
gtk_container_add (GTK_CONTAINER (layout), GTK_WIDGET (object));
gtk_widget_show (GTK_WIDGET (object));
gtk_widget_show (layout);
diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c
index 7655898..6126a01 100644
--- a/gladeui/glade-editor-property.c
+++ b/gladeui/glade-editor-property.c
@@ -3002,8 +3002,6 @@ glade_eprop_object_show_dialog (GtkWidget * dialog_button,
if (new_object && old_object != new_object)
{
- glade_widget_hide (new_widget);
-
if ((old_ref =
glade_widget_get_parentless_widget_ref (new_widget)))
{
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index d65d095..33a3e42 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -4029,6 +4029,20 @@ glade_project_display_dependencies (GladeProject * project)
return g_string_free (string, FALSE);
}
+/**
+ * glade_project_toplevels:
+ * @project: a #GladeProject
+ *
+ * Returns: a #GList containing the #GtkWidget toplevel items in @project
+ */
+GList *
+glade_project_toplevels (GladeProject * project)
+{
+ g_return_val_if_fail (GLADE_IS_PROJECT (project), NULL);
+
+ return project->priv->tree;
+}
+
/* GtkTreeModel implementation */
static GObject *
diff --git a/gladeui/glade-project.h b/gladeui/glade-project.h
index 5305147..5edb1c9 100644
--- a/gladeui/glade-project.h
+++ b/gladeui/glade-project.h
@@ -209,6 +209,8 @@ void glade_project_get_target_version (GladeProject *proj
GList *glade_project_required_libs (GladeProject *project);
gchar *glade_project_display_dependencies (GladeProject *project);
+GList *glade_project_toplevels (GladeProject *project);
+
/* Verifications */
gchar *glade_project_verify_widget_adaptor(GladeProject *project,
GladeWidgetAdaptor *adaptor,
diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c
index a0b969d..b4585ad 100644
--- a/gladeui/glade-property.c
+++ b/gladeui/glade-property.c
@@ -367,6 +367,21 @@ glade_property_set_value_impl (GladeProperty * property, const GValue * value)
glade_project_verify_property (property);
}
+ /* Special case parentless widget properties */
+ if (glade_property_class_parentless_widget (property->priv->klass))
+ {
+ GladeWidget *gobj;
+ GObject *obj;
+
+ if ((obj = g_value_get_object (&old_value)) &&
+ (gobj = glade_widget_get_from_gobject (obj)))
+ glade_widget_show (gobj);
+
+ if ((obj = g_value_get_object (value)) &&
+ (gobj = glade_widget_get_from_gobject (obj)))
+ glade_widget_hide (gobj);
+ }
+
g_value_unset (&old_value);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]