From: Jose Dapena Paz Date: Wed, 28 Oct 2009 11:56:13 +0000 (+0100) Subject: Better wrap of fields in details dialog (taking the whole width). X-Git-Tag: 3.1.8~5 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=8660939f1e42d46b2c7fd094eb2e1191b970e38f 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). --- diff --git a/src/widgets/modest-details-dialog.c b/src/widgets/modest-details-dialog.c index 9b520f2..db48492 100644 --- a/src/widgets/modest-details-dialog.c +++ b/src/widgets/modest-details-dialog.c @@ -64,6 +64,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, @@ -195,6 +199,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); @@ -424,6 +431,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) {