From a47f178df47ae26bf080b5c4f34762102c58085e Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sat, 27 Sep 2014 16:47:27 +0300 Subject: 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 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 NOTE: Patch copied from mutter and adapted for metacity. --- src/ui/frames.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ui/frames.c') diff --git a/src/ui/frames.c b/src/ui/frames.c index 90e2b2d8..a8cb96fa 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -482,6 +482,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); pango_layout_set_single_paragraph_mode (frame->layout, TRUE); -- cgit v1.2.1