]> spindle.queued.net Git - midori/commitdiff
Ellipsize label in infobars created by MidoriView
authorPaweł Forysiuk <tuxator@o2.pl>
Thu, 21 Apr 2011 18:51:03 +0000 (20:51 +0200)
committerChristian Dywan <christian@twotoasts.de>
Thu, 21 Apr 2011 18:51:03 +0000 (20:51 +0200)
So overly long messages don't cause the window to grow.

midori/midori-view.c

index f8d0fd886e3a7f5cea1f17fab343bf3d5ff2ef64..f7b40e5321fdab94241018ffd16ab1ab9ef9c857 100644 (file)
@@ -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);