summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2009-10-27 17:41:43 -0400
committerThomas Thurman <tthurman@gnome.org>2009-10-27 17:41:43 -0400
commite616621d384605d695c48d5fcb312753974c5e00 (patch)
tree044f787dec22b968b3da210144c821f9f1b709ed
parent179cb4245bf4b9cf7df9be95a27bfcb191ac6ec6 (diff)
downloadmetacity-e616621d384605d695c48d5fcb312753974c5e00.tar.gz
make text centring/right-justifying actually work
-rw-r--r--src/ui/theme.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 15f61d98..a9d4c59a 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -466,6 +466,26 @@ meta_theme_draw_frame_with_style (MetaTheme *theme,
fgeom.areas[CC_TITLE].x + fgeom.areas[CC_TITLE].left_edge,
fgeom.areas[CC_TITLE].y + fgeom.areas[CC_TITLE].top_edge);
+ pango_layout_set_width (title_layout, fgeom.areas[CC_TITLE].width);
+ pango_layout_set_height (title_layout, fgeom.areas[CC_TITLE].height);
+
+ switch (pango_layout_get_alignment (title_layout))
+ {
+ case PANGO_ALIGN_RIGHT:
+ cairo_translate (cr,
+ fgeom.areas[CC_TITLE].width,
+ 0);
+ break;
+ case PANGO_ALIGN_CENTER:
+ cairo_translate (cr,
+ fgeom.areas[CC_TITLE].width/2,
+ 0);
+ break;
+ default:
+ /* nothing */
+ break;
+ }
+
pango_cairo_show_layout (cr, title_layout);
cairo_destroy (cr);