Allow a theme to specify ellipsize width for a title

It's nice to indicate when a title is truncated with an ellipsis.
Because themes may draw a title multiple times to draw a shadow, or
may include the window icon within the title area, we can't determine
the proper ellipsization width automatically, so add an optional
attribute to the <title/> element "ellipsize_width" which, if set,
is the width to ellipsize at.

This is only enabled if a theme version of 3.1 is required.

When it's not set, we keep the old behavior of just letting the
title be clipped with a hard edge.

https://bugzilla.gnome.org/show_bug.cgi?id=591842
This commit is contained in:
Owen W. Taylor
2009-08-20 15:54:11 -04:00
parent e8e78ebfdd
commit 1d7476a725
5 changed files with 64 additions and 4 deletions

View File

@@ -501,6 +501,7 @@ meta_frames_ensure_layout (MetaFrames *frames,
frame->layout = gtk_widget_create_pango_layout (widget, frame->title);
pango_layout_set_ellipsize (frame->layout, PANGO_ELLIPSIZE_END);
pango_layout_set_auto_dir (frame->layout, FALSE);
font_desc = meta_gtk_widget_get_font_desc (widget, scale,