[epiphany-extensions/tabs-reloaded] Always render the title from the top row onwards



commit 962875c95c0c3d9a28e1b9b0cd5bee6a9fa7e44a
Author: Benjamin Otte <otte gnome org>
Date:   Sun Aug 23 15:03:00 2009 +0200

    Always render the title from the top row onwards

 extensions/tabs-reloaded/ephy-cell-renderer-tab.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/extensions/tabs-reloaded/ephy-cell-renderer-tab.c b/extensions/tabs-reloaded/ephy-cell-renderer-tab.c
index 8b8e3c6..55087cb 100644
--- a/extensions/tabs-reloaded/ephy-cell-renderer-tab.c
+++ b/extensions/tabs-reloaded/ephy-cell-renderer-tab.c
@@ -208,11 +208,14 @@ ephy_cell_renderer_tab_render (GtkCellRenderer      *cell,
   layout = gtk_widget_create_pango_layout (widget,
                                            ephy_web_view_get_title (view));
   pango_layout_set_width (layout, width * PANGO_SCALE);
-  if (pango_layout_get_line_count (layout) >= n_columns)
-    {
-      if (ephy_web_view_get_icon (view))
-        pango_layout_set_indent (layout, icon_width * PANGO_SCALE);
-    }
+  if (ephy_web_view_get_icon (view))
+    pango_layout_set_indent (layout, icon_width * PANGO_SCALE);
+  /* 
+   * If wrapping words is not enough, wrap chars instead.
+   * This way, as much title text as possible is visible.
+   */
+  if (pango_layout_get_line_count (layout) > n_columns)
+    pango_layout_set_wrap (layout, PANGO_WRAP_CHAR);
   pango_layout_set_height (layout, -(int)n_columns);
   pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END);
   gtk_paint_layout (widget->style,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]