[glade3/offscreen-gtk3] gladeui: Fix crash in glade-editor-property



commit 6117213a10ba2a7e291ae4b71e9d286a7dda639c
Author: Johannes Schmid <jhs gnome org>
Date:   Mon Nov 15 14:52:51 2010 +0100

    gladeui: Fix crash in glade-editor-property
    
    Seems that calling size_request() inside allocate() isn't a good idea.

 gladeui/glade-editor-property.c |   34 ----------------------------------
 1 files changed, 0 insertions(+), 34 deletions(-)
---
diff --git a/gladeui/glade-editor-property.c b/gladeui/glade-editor-property.c
index 1968a03..1dd675b 100644
--- a/gladeui/glade-editor-property.c
+++ b/gladeui/glade-editor-property.c
@@ -243,36 +243,6 @@ glade_editor_property_button_pressed (GtkWidget           *widget,
 }
 
 
-#define EDITOR_COLUMN_SIZE 90
-
-static void
-eprop_item_label_size_allocate_after (GtkWidget *widget, GtkAllocation *allocation,
-				      GladeEditorProperty *eprop)
-{
-	gint width = EDITOR_COLUMN_SIZE;
-	gint icon_width = 0;
-
-	if (gtk_widget_get_visible (eprop->warning) && gtk_widget_get_mapped (eprop->warning))
-	{
-		GtkRequisition req = { -1, -1 };
-		gtk_widget_size_request (eprop->warning, &req);
-		/* Here we have to subtract the icon and remaining
-		 * padding inside eprop->item_label so that we are
-		 * only dealing with the size of the label.
-		 * (note the '4' here comes from the hbox spacing).
-		 */
-		icon_width = req.width + 4;
-	}
-
-	if (allocation->width > width)
-		width = allocation->width;
-
-	gtk_widget_set_size_request (eprop->label, CLAMP (width - icon_width, 0, width), -1);
-	/* Sometimes labels aren't drawn correctly after resize without this */
-	gtk_widget_queue_draw (eprop->label);
-}
-
-
 static GObject *
 glade_editor_property_constructor (GType                  type,
 				   guint                  n_construct_properties,
@@ -318,10 +288,6 @@ glade_editor_property_constructor (GType                  type,
 	gtk_label_set_line_wrap (GTK_LABEL(eprop->label), TRUE);
 	gtk_label_set_line_wrap_mode (GTK_LABEL(eprop->label), PANGO_WRAP_WORD_CHAR);
 
-	/* A Hack so that PANGO_WRAP_WORD_CHAR works nicely */
-	g_signal_connect_after (G_OBJECT (eprop->item_label), "size-allocate",
-				G_CALLBACK (eprop_item_label_size_allocate_after), eprop);
-
 	gtk_misc_set_alignment (GTK_MISC(eprop->label), 1.0, 0.5);
 
 	gtk_box_pack_start (GTK_BOX (hbox), eprop->label, TRUE, TRUE, 0);



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