From 17d458b0ca9cde577c679bfcd666e4f9a865b8b2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Forysiuk?= Date: Thu, 21 Apr 2011 20:51:03 +0200 Subject: [PATCH] Ellipsize label in infobars created by MidoriView So overly long messages don't cause the window to grow. --- midori/midori-view.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index f8d0fd88..f7b40e53 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -1271,6 +1271,7 @@ midori_view_add_info_bar (MidoriView* view, GtkWidget* infobar; GtkWidget* action_area; GtkWidget* content_area; + GtkWidget* label; va_list args; const gchar* button_text; @@ -1320,7 +1321,9 @@ midori_view_add_info_bar (MidoriView* view, #endif va_end (args); - gtk_container_add (GTK_CONTAINER (content_area), gtk_label_new (message)); + label = gtk_label_new (message); + gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END); + gtk_container_add (GTK_CONTAINER (content_area), label); gtk_widget_show_all (infobar); gtk_box_pack_start (GTK_BOX (view), infobar, FALSE, FALSE, 0); gtk_box_reorder_child (GTK_BOX (view), infobar, 0); -- 2.39.5