]> Dogcows Code - chaz/openbox/commitdiff
when drawing and measuring strings in "flow" mode, don't ellipsize so that lines...
authorDana Jansens <danakj@orodu.net>
Thu, 7 Feb 2008 06:34:34 +0000 (01:34 -0500)
committerDana Jansens <danakj@orodu.net>
Thu, 14 Feb 2008 19:24:37 +0000 (14:24 -0500)
render/font.c

index 2f06c731d1f09ace4d62849660e4b68c3bfa45b2..583c9f7d7af277b2986429a4036fabc38500f907 100644 (file)
@@ -148,11 +148,13 @@ static void font_measure_full(const RrFont *f, const gchar *str,
     if (flow) {
         pango_layout_set_single_paragraph_mode(f->layout, FALSE);
         pango_layout_set_width(f->layout, maxwidth * PANGO_SCALE);
+        pango_layout_set_ellipsize(f->layout, PANGO_ELLIPSIZE_NONE);
     }
     else {
         /* single line mode */
         pango_layout_set_single_paragraph_mode(f->layout, TRUE);
         pango_layout_set_width(f->layout, -1);
+        pango_layout_set_ellipsize(f->layout, PANGO_ELLIPSIZE_MIDDLE);
     }
 
     /* pango_layout_get_pixel_extents lies! this is the right way to get the
@@ -240,19 +242,23 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
     w -= 4;
     h = area->height;
 
-    switch (t->ellipsize) {
-    case RR_ELLIPSIZE_NONE:
+    if (t->flow)
         ell = PANGO_ELLIPSIZE_NONE;
-        break;
-    case RR_ELLIPSIZE_START:
-        ell = PANGO_ELLIPSIZE_START;
-        break;
-    case RR_ELLIPSIZE_MIDDLE:
-        ell = PANGO_ELLIPSIZE_MIDDLE;
-        break;
-    case RR_ELLIPSIZE_END:
-        ell = PANGO_ELLIPSIZE_END;
-        break;
+    else {
+        switch (t->ellipsize) {
+        case RR_ELLIPSIZE_NONE:
+            ell = PANGO_ELLIPSIZE_NONE;
+            break;
+        case RR_ELLIPSIZE_START:
+            ell = PANGO_ELLIPSIZE_START;
+            break;
+        case RR_ELLIPSIZE_MIDDLE:
+            ell = PANGO_ELLIPSIZE_MIDDLE;
+            break;
+        case RR_ELLIPSIZE_END:
+            ell = PANGO_ELLIPSIZE_END;
+            break;
+        }
     }
 
     pango_layout_set_text(t->font->layout, t->string, -1);
This page took 0.025892 seconds and 4 git commands to generate.