summaryrefslogtreecommitdiff
path: root/gtk/window-decorator/switcher.c
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-02-15 22:24:41 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-02-15 22:24:41 +0800
commit5f94d553e900a4cd51dee850df26ac5856d65c15 (patch)
tree6bc3125438f34bc99ad7fee54d17921b780782c6 /gtk/window-decorator/switcher.c
parent552af63a1a5b2be7d3eb599ca95aa5ef58ed6d68 (diff)
downloadcompiz-with-glib-mainloop-5f94d553e900a4cd51dee850df26ac5856d65c15.tar.gz
compiz-with-glib-mainloop-5f94d553e900a4cd51dee850df26ac5856d65c15.tar.bz2
Allow different font types in frames.
Currently we used a single PangoContext and PangoFontDescription for everything ... this resulted in custom frames having the same titlebar size which wasn't any good. This commit changes a lot, namely: * Frame is now linked to the decoration object itself * Moved style windows into the frame * Moved font context and font description into the frame * Added API for getting the titlebar font size: obviously with the cairo decorations there isn't supposed to be any kind of visual difference here but with the metacity decorations we need to get that directly from libmetacity. It should be noted that these commits are in need of a cleanup ... which is coming in the next few commits.
Diffstat (limited to 'gtk/window-decorator/switcher.c')
-rw-r--r--gtk/window-decorator/switcher.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/window-decorator/switcher.c b/gtk/window-decorator/switcher.c
index 6da0475..2962999 100644
--- a/gtk/window-decorator/switcher.c
+++ b/gtk/window-decorator/switcher.c
@@ -16,7 +16,7 @@ draw_switcher_background (decor_t *d)
if (!d->buffer_pixmap)
return;
- style = gtk_widget_get_style (style_window_rgba);
+ style = gtk_widget_get_style (switcher_style_window_rgba);
color.r = style->bg[GTK_STATE_NORMAL].red / 65535.0;
color.g = style->bg[GTK_STATE_NORMAL].green / 65535.0;
@@ -207,7 +207,7 @@ draw_switcher_foreground (decor_t *d)
if (!d->pixmap || !d->buffer_pixmap)
return;
- style = gtk_widget_get_style (style_window_rgba);
+ style = gtk_widget_get_style (switcher_style_window_rgba);
cr = gdk_cairo_create (GDK_DRAWABLE (d->buffer_pixmap));
@@ -238,7 +238,7 @@ draw_switcher_foreground (decor_t *d)
cairo_move_to (cr, d->width / 2 - w / 2,
d->height - switcher_context.bottom_space +
- SWITCHER_SPACE / 2 - text_height / 2);
+ SWITCHER_SPACE / 2 - d->frame->text_height / 2);
pango_cairo_show_layout (cr, d->layout);
}
@@ -346,7 +346,7 @@ update_switcher_window (Window popup,
{
if (!d->layout)
{
- d->layout = pango_layout_new (pango_context);
+ d->layout = pango_layout_new (switcher_pango_context);
if (d->layout)
pango_layout_set_wrap (d->layout, PANGO_WRAP_CHAR);
}
@@ -399,11 +399,11 @@ update_switcher_window (Window popup,
switcher_selected_window = selected;
}
- pixmap = create_pixmap (width, height, 32);
+ pixmap = create_pixmap (width, height, switcher_style_window_rgba);
if (!pixmap)
return FALSE;
- buffer_pixmap = create_pixmap (width, height, 32);
+ buffer_pixmap = create_pixmap (width, height, switcher_style_window_rgb);
if (!buffer_pixmap)
{
g_object_unref (G_OBJECT (pixmap));