[metacity/cowbell] Style supplied title layout
- From: Thomas James Alexander Thurman <tthurman src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [metacity/cowbell] Style supplied title layout
- Date: Mon, 19 Oct 2009 20:54:33 +0000 (UTC)
commit 7a00ca68899cee05f85e39682efdd32a170528e1
Author: Thomas Thurman <tthurman gnome org>
Date: Mon Oct 19 15:59:28 2009 -0400
Style supplied title layout
src/ui/theme.c | 20 +++++---------------
1 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 665eef7..85f1a25 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -394,21 +394,17 @@ draw_rectangle (ccss_stylesheet_t *stylesheet,
return full_width;
}
-#if 0
-static PangoLayout*
-cowbell_title_text (ccss_stylesheet_t *stylesheet,
- cairo_t *cr,
- char *text)
+static void
+cowbell_style_title_text (ccss_stylesheet_t *stylesheet,
+ PangoLayout *layout,
+ cairo_t *cr)
{
- PangoLayout *layout;
PangoAttrList *attrs = NULL;
ccss_style_t *style = ccss_stylesheet_query (stylesheet,
(ccss_node_t*) &cowbell_nodes[CC_TITLE]);
char *align;
ccss_color_t const *colour;
- layout = pango_cairo_create_layout (cr);
-
attrs = pango_attr_list_new ();
/* We have to handle CSS text properties ourselves here because
@@ -452,15 +448,9 @@ cowbell_title_text (ccss_stylesheet_t *stylesheet,
pango_layout_set_attributes (layout, attrs);
- /* The actual text */
- pango_layout_set_text (layout, text, -1);
-
ccss_style_destroy (style);
pango_attr_list_unref (attrs);
-
- return layout;
}
-#endif
void
meta_theme_draw_frame_with_style (MetaTheme *theme,
@@ -500,7 +490,7 @@ meta_theme_draw_frame_with_style (MetaTheme *theme,
CopperClasses *cursor;
int leftpos, rightpos;
- /* PangoLayout *layout = cowbell_title_text (stylesheet, cr, "Badgers");*/
+ cowbell_style_title_text (stylesheet, title_layout, cr);
pango_layout_get_pixel_extents (title_layout, NULL, &text_extents);
reduce_by_padding_borders_and_margins (stylesheet, CC_TITLE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]