diff options
author | Johannes Schmid <jhs@gnome.org> | 2010-11-15 14:52:51 +0100 |
---|---|---|
committer | Johannes Schmid <jhs@gnome.org> | 2010-11-15 15:48:51 +0100 |
commit | 6117213a10ba2a7e291ae4b71e9d286a7dda639c (patch) | |
tree | 1709b574f79a0909351883e4eb4c2ce40a66a2f5 /gladeui/glade-editor-property.c | |
parent | 177b9bfbe9cb448cca0a34b213c9bfbb3eed5f74 (diff) | |
download | glade-6117213a10ba2a7e291ae4b71e9d286a7dda639c.tar.gz |
gladeui: Fix crash in glade-editor-property
Seems that calling size_request() inside allocate() isn't a good idea.
Diffstat (limited to 'gladeui/glade-editor-property.c')
-rw-r--r-- | 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 1968a038..1dd675b8 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); |