From e94acb8f944e4162c2c2ac87b351530bab12c7eb Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Wed, 28 Oct 2009 12:56:13 +0100 Subject: [PATCH] Better wrap of fields in details dialog (taking the whole width). * src/widgets/modest-details-dialog.c (modest_details_dialog_add_data_default): update size request of value labels if their container is also resized, so they wrap at proper point (fixes NB#139032). --- src/widgets/modest-details-dialog.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/widgets/modest-details-dialog.c b/src/widgets/modest-details-dialog.c index 223e93c..08db041 100644 --- a/src/widgets/modest-details-dialog.c +++ b/src/widgets/modest-details-dialog.c @@ -61,6 +61,10 @@ static void modest_details_dialog_add_data_default (ModestDetailsD const gchar *label, const gchar *value); +static gboolean on_key_press_event (GtkWindow *window, GdkEventKey *event, gpointer userdata); + +static void value_w_size_allocate (GtkWidget *label, GtkAllocation *allocation, gpointer data); + G_DEFINE_TYPE (ModestDetailsDialog, modest_details_dialog, @@ -192,6 +196,9 @@ modest_details_dialog_add_data_default (ModestDetailsDialog *self, /* Create value */ value_w = gtk_label_new (secure_value); + g_signal_connect (G_OBJECT (value_w), "size-allocate", + G_CALLBACK (value_w_size_allocate), NULL); + gtk_label_set_line_wrap ((GtkLabel *) value_w, TRUE); gtk_label_set_line_wrap_mode ((GtkLabel *) value_w, PANGO_WRAP_WORD_CHAR); gtk_misc_set_alignment (GTK_MISC (value_w), 0.0, 0.0); @@ -421,6 +428,12 @@ modest_details_dialog_set_folder_default (ModestDetailsDialog *self, g_free (count_s); } +static void +value_w_size_allocate (GtkWidget *label, GtkAllocation *allocation, gpointer data) +{ + gtk_widget_set_size_request(label, allocation->width, -1); +} + static gboolean on_key_press_event (GtkWindow *window, GdkEventKey *event, gpointer userdata) { -- 1.7.9.5