glade3 r2036 - trunk/plugins/gtk+
- From: tvb svn gnome org
- To: svn-commits-list gnome org
- Subject: glade3 r2036 - trunk/plugins/gtk+
- Date: Wed, 19 Nov 2008 19:27:28 +0000 (UTC)
Author: tvb
Date: Wed Nov 19 19:27:28 2008
New Revision: 2036
URL: http://svn.gnome.org/viewvc/glade3?rev=2036&view=rev
Log:
hide property/attribute when not needed, fixed saving properties.
Modified:
trunk/plugins/gtk+/glade-cell-renderer-editor.c
trunk/plugins/gtk+/glade-gtk.c
Modified: trunk/plugins/gtk+/glade-cell-renderer-editor.c
==============================================================================
--- trunk/plugins/gtk+/glade-cell-renderer-editor.c (original)
+++ trunk/plugins/gtk+/glade-cell-renderer-editor.c Wed Nov 19 19:27:28 2008
@@ -42,6 +42,11 @@
GladePropertyClass *pclass;
GladePropertyClass *attr_pclass;
GladePropertyClass *use_attr_pclass;
+
+ GtkWidget *use_prop_label;
+ GtkWidget *use_attr_label;
+ GtkWidget *use_prop_eprop;
+ GtkWidget *use_attr_eprop;
} CheckTab;
G_DEFINE_TYPE_WITH_CODE (GladeCellRendererEditor, glade_cell_renderer_editor, GTK_TYPE_VBOX,
@@ -140,6 +145,22 @@
glade_widget_property_get (widget, tab->use_attr_pclass->id, &use_attr);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tab->attributes_check), use_attr);
+
+
+ if (use_attr)
+ {
+ gtk_widget_show (tab->use_attr_label);
+ gtk_widget_show (tab->use_attr_eprop);
+ gtk_widget_hide (tab->use_prop_label);
+ gtk_widget_hide (tab->use_prop_eprop);
+ }
+ else
+ {
+ gtk_widget_show (tab->use_prop_label);
+ gtk_widget_show (tab->use_prop_eprop);
+ gtk_widget_hide (tab->use_attr_label);
+ gtk_widget_hide (tab->use_attr_eprop);
+ }
}
}
renderer_editor->loading = FALSE;
@@ -441,6 +462,9 @@
renderer_editor->properties = g_list_prepend (renderer_editor->properties, eprop);
gtk_size_group_add_widget (input_group, GTK_WIDGET (eprop));
+ tab->use_prop_label = eprop->item_label;
+ tab->use_prop_eprop = GTK_WIDGET (eprop);
+
/* Edit attribute */
eprop = glade_widget_adaptor_create_eprop (adaptor, attr_pclass, TRUE);
table_attach (table, eprop->item_label, 0, rows);
@@ -448,6 +472,9 @@
renderer_editor->properties = g_list_prepend (renderer_editor->properties, eprop);
gtk_size_group_add_widget (input_group, GTK_WIDGET (eprop));
+ tab->use_attr_label = eprop->item_label;
+ tab->use_attr_eprop = GTK_WIDGET (eprop);
+
g_signal_connect (G_OBJECT (tab->attributes_check), "toggled",
G_CALLBACK (attributes_toggled), tab);
Modified: trunk/plugins/gtk+/glade-gtk.c
==============================================================================
--- trunk/plugins/gtk+/glade-gtk.c (original)
+++ trunk/plugins/gtk+/glade-gtk.c Wed Nov 19 19:27:28 2008
@@ -10374,7 +10374,7 @@
glade_widget_property_get (widget, use_attr_str, &use_attr);
attr_name = &property->klass->id[attr_len];
- prop = glade_widget_get_property (widget, "attr_name");
+ prop = glade_widget_get_property (widget, attr_name);
if (!use_attr && prop)
glade_property_write (prop, context, node);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]