glade3 r1996 - in trunk: . doc gladeui plugins/gtk+



Author: tvb
Date: Sat Oct 25 06:01:51 2008
New Revision: 1996
URL: http://svn.gnome.org/viewvc/glade3?rev=1996&view=rev

Log:

	* gladeui/glade-property-class.c: Fixed glade_property_class_make_adjustment()
	for floating and double values (page inc and size were not properly set).

	* gladeui/glade-app.c: Fixed a warning

	* gladeui/glade-editor-table.c: Was loading invisible properties, oops.
	
	* doc/properties.sgml: Documented custom-layout property.



Modified:
   trunk/ChangeLog
   trunk/doc/properties.sgml
   trunk/gladeui/glade-app.c
   trunk/gladeui/glade-editor-table.c
   trunk/gladeui/glade-property-class.c
   trunk/plugins/gtk+/gtk+.xml.in

Modified: trunk/doc/properties.sgml
==============================================================================
--- trunk/doc/properties.sgml	(original)
+++ trunk/doc/properties.sgml	Sat Oct 25 06:01:51 2008
@@ -151,7 +151,18 @@
           <term>visible</term>
           <listitem>
             <para>
-Whether to show the property in the editor (default "True")
+Whether to show the property in the editor and reset dialog (default "True")
+            </para>
+          </listitem>
+        </varlistentry>
+
+        <varlistentry>
+          <term>custom-layout</term>
+          <listitem>
+            <para>
+This is used to avoid loading this property in the editor when implementing
+a custom #GladeEditable that embeds the base #GladeEditorTable implementation,
+custom-layout properties will still show up in the reset dialog (default "False)
             </para>
           </listitem>
         </varlistentry>

Modified: trunk/gladeui/glade-app.c
==============================================================================
--- trunk/gladeui/glade-app.c	(original)
+++ trunk/gladeui/glade-app.c	Sat Oct 25 06:01:51 2008
@@ -1347,7 +1347,7 @@
 	for (list = glade_app_get_selection ();
 	     list && list->data; list = list->next)
 	{
-		widget  = glade_widget_get_from_gobject (GTK_WIDGET (list->data));
+		widget  = glade_widget_get_from_gobject (list->data);
 		widgets = g_list_prepend (widgets, widget);
 		
 		g_assert (widget);

Modified: trunk/gladeui/glade-editor-table.c
==============================================================================
--- trunk/gladeui/glade-editor-table.c	(original)
+++ trunk/gladeui/glade-editor-table.c	Sat Oct 25 06:01:51 2008
@@ -206,7 +206,7 @@
 
 	properties = (type == GLADE_PAGE_PACKING) ? adaptor->packing_props : adaptor->properties;
 
-	for (l = properties; l && l->data; l = g_list_next (l))
+	for (l = properties; l; l = g_list_next (l))
 	{
 		GladePropertyClass *klass = l->data;
 
@@ -214,9 +214,11 @@
 		 * invisible properties, allow adaptors to filter out properties from
 		 * the GladeEditorTable using the "custom-layout" attribute.
 		 */
-		if (!klass->custom_layout && GLADE_PROPERTY_CLASS_IS_TYPE (klass, type) &&
-		    (glade_property_class_is_visible (klass) || type != GLADE_PAGE_QUERY))
+		if ((!klass->custom_layout) && GLADE_PROPERTY_CLASS_IS_TYPE (klass, type) &&
+		    (glade_property_class_is_visible (klass) || type == GLADE_PAGE_QUERY))
+		{
 			list = g_list_prepend (list, klass);
+		}
 			
 	}
 	return g_list_sort (list, property_class_comp);

Modified: trunk/gladeui/glade-property-class.c
==============================================================================
--- trunk/gladeui/glade-property-class.c	(original)
+++ trunk/gladeui/glade-property-class.c	Sat Oct 25 06:01:51 2008
@@ -50,10 +50,13 @@
 #include "glade-debug.h"
 
 #define NUMERICAL_STEP_INCREMENT   1
-#define FLOATING_STEP_INCREMENT    0.01F
 #define NUMERICAL_PAGE_INCREMENT   10
 #define NUMERICAL_PAGE_SIZE        1
 
+#define FLOATING_STEP_INCREMENT    0.01F
+#define FLOATING_PAGE_INCREMENT    0.1F
+#define FLOATING_PAGE_SIZE         0.01F
+
 /**
  * glade_property_class_new:
  * @handle: A generic pointer (i.e. a #GladeWidgetClass)
@@ -1181,6 +1184,7 @@
 GtkAdjustment *
 glade_property_class_make_adjustment (GladePropertyClass *property_class)
 {
+	GtkAdjustment *adjustment;
 	gdouble        min = 0, max = 0, def = 0;
 	gboolean       float_range = FALSE;
 
@@ -1220,9 +1224,9 @@
 	} else if (G_IS_PARAM_SPEC_FLOAT(property_class->pspec))
 	{
 		float_range = TRUE;
-		min = (gdouble)((GParamSpecFloat *) property_class->pspec)->minimum;
-		max = (gdouble)((GParamSpecFloat *) property_class->pspec)->maximum;
-		def = (gdouble)((GParamSpecFloat *) property_class->pspec)->default_value;
+		min = ((GParamSpecFloat *) property_class->pspec)->minimum;
+		max = ((GParamSpecFloat *) property_class->pspec)->maximum;
+		def = ((GParamSpecFloat *) property_class->pspec)->default_value;
 	} else if (G_IS_PARAM_SPEC_DOUBLE(property_class->pspec))
 	{
 		float_range = TRUE;
@@ -1235,12 +1239,15 @@
 			    g_type_name(G_PARAM_SPEC_TYPE (property_class->pspec)));
 	}
 
-	return (GtkAdjustment *)gtk_adjustment_new (def, min, max,
-						    float_range ?
-						    FLOATING_STEP_INCREMENT :
-						    NUMERICAL_STEP_INCREMENT,
-						    NUMERICAL_PAGE_INCREMENT,
-						    NUMERICAL_PAGE_SIZE);
+	adjustment = (GtkAdjustment *)gtk_adjustment_new (def, min, max,
+							  float_range ?
+							  FLOATING_STEP_INCREMENT :
+							  NUMERICAL_STEP_INCREMENT,
+							  float_range ? FLOATING_PAGE_INCREMENT :
+							  NUMERICAL_PAGE_INCREMENT,
+							  float_range ? FLOATING_PAGE_SIZE :
+							  NUMERICAL_PAGE_SIZE);
+	return adjustment;
 }
 
 /**
@@ -1419,6 +1426,7 @@
 		glade_xml_get_property_boolean (node, GLADE_TAG_LIBGLADE_UNSUPPORTED, 
 						klass->libglade_unsupported);
 
+
 	if ((buf = glade_xml_get_property_string
 	     (node, GLADE_TAG_FACTORY_STOCK_ID)) != NULL)
 	{

Modified: trunk/plugins/gtk+/gtk+.xml.in
==============================================================================
--- trunk/plugins/gtk+/gtk+.xml.in	(original)
+++ trunk/plugins/gtk+/gtk+.xml.in	Sat Oct 25 06:01:51 2008
@@ -674,7 +674,7 @@
 	  <_tooltip>The stock item for this button</_tooltip>
 	</property>
 
-        <property id="custom-child" save="False" visible="False" default="False">
+        <property id="custom-child" save="False" custom-layout="True" default="False">
           <spec>glade_standard_boolean_spec</spec>
         </property>
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]