[glade3] * plugins/gtk+/gtk+.xml.in: Fixed GtkButton to only allow real stock items,



commit ec6f436fb257a3ecb0888fb0ebc056f0b0427045
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sat Apr 18 16:27:11 2009 -0400

    	* plugins/gtk+/gtk+.xml.in: Fixed GtkButton to only allow real stock items,
    	gave GtkImage a default icon-size of GTK_ICON_SIZE_BUTTON (better than invalid).
---
 ChangeLog                       |    3 +++
 gladeui/glade-editor-property.c |    9 ++++++---
 plugins/gtk+/gtk+.xml.in        |    5 +++--
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6d8ef44..fe053b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-04-18  Tristan Van Berkom <tvb gnome org>
 
+	* plugins/gtk+/gtk+.xml.in: Fixed GtkButton to only allow real stock items,
+	gave GtkImage a default icon-size of GTK_ICON_SIZE_BUTTON (better than invalid).
+
 	* plugins/gtk+/glade-activatable-editor.c, 
 	gladeui/glade-editor-property.c: Maintain current widget selection
 	during commits of related-action (was causing crashes when the
diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c
index 5d3fb3b..f5d9555 100644
--- a/gladeui/glade-editor-property.c
+++ b/gladeui/glade-editor-property.c
@@ -2101,9 +2101,12 @@ glade_eprop_text_create_input (GladeEditorProperty *eprop)
 						"stock-id", COMBO_COLUMN_PIXBUF,
 						NULL);
 
-		/* Allow any stock item, even when we should require valid builtin
-		 * item with a label */
-		gtk_entry_set_editable (GTK_ENTRY (GTK_BIN (combo)->child), TRUE);
+		/* Dont allow custom items where an actual GTK+ stock item is expected
+		 * (i.e. real items come with labels) */
+		if (klass->stock)	
+			gtk_entry_set_editable (GTK_ENTRY (GTK_BIN (combo)->child), FALSE);
+		else
+			gtk_entry_set_editable (GTK_ENTRY (GTK_BIN (combo)->child), TRUE);
 		
 		gtk_widget_show (combo);
 		gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0); 
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index c9aa092..ef26d47 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -989,7 +989,7 @@ embedded in another object</_tooltip>
             <visible-lines>2</visible-lines>
 	</property>
 	<property id="use-underline" custom-layout="True"/>
-	<property id="stock" _name="Stock Button" stock-icon="True" save="False" custom-layout="True">
+	<property id="stock" _name="Stock Button" stock="True" save="False" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamString</type>
 	  </parameter-spec>
@@ -1273,7 +1273,8 @@ embedded in another object</_tooltip>
 	<property id="pixbuf" _name="File Name" custom-layout="True"/>
 	<property id="pixel-size" custom-layout="True"/>
 	<!-- We have to save/load icon-size as int, and fake the enum -->
-	<property id="icon-size" _name="Icon Size" custom-layout="True" save="False">
+	<property id="icon-size" _name="Icon Size" custom-layout="True" 
+		  default="GTK_ICON_SIZE_BUTTON" save="False">
 	  <parameter-spec>
 	    <type>GParamEnum</type>
 	    <value-type>GtkIconSize</value-type>



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