diff options
Diffstat (limited to 'typing-break')
-rw-r--r-- | typing-break/drw-break-window.c | 31 | ||||
-rw-r--r-- | typing-break/drw-utils.c | 21 |
2 files changed, 21 insertions, 31 deletions
diff --git a/typing-break/drw-break-window.c b/typing-break/drw-break-window.c index bb9edefe..87e7ec3f 100644 --- a/typing-break/drw-break-window.c +++ b/typing-break/drw-break-window.c @@ -605,7 +605,7 @@ label_expose_event_cb (GtkLabel *label, GtkWidget *widget; GdkWindow *window; #if !GTK_CHECK_VERSION (3, 0, 0) - GdkGC *gc; + cairo_t *cr; #endif color.red = 0; @@ -618,23 +618,24 @@ label_expose_event_cb (GtkLabel *label, widget = GTK_WIDGET (label); window = gtk_widget_get_window (widget); -#if !GTK_CHECK_VERSION (3, 0, 0) - gc = gdk_gc_new (window); - gdk_gc_set_rgb_fg_color (gc, &color); - gdk_gc_set_clip_rectangle (gc, &event->area); -#endif - #if GTK_CHECK_VERSION (3, 0, 0) pango_cairo_show_layout (cr, gtk_label_get_layout (label)); #else - gdk_draw_layout_with_colors (window, - gc, - x + 1, - y + 1, - gtk_label_get_layout (label), - &color, - NULL); - g_object_unref (gc); + cr = gdk_cairo_create (window); + + gdk_cairo_rectangle (cr, &event->area); + cairo_clip (cr); + + cairo_set_source_rgb (cr, 0, 0, 0); + + /* Can't use pango_cairo_show_layout() here as we need to override + * the layout's colors with our shadow color. + */ + cairo_move_to (cr, x + 1, y + 1); + pango_cairo_layout_path (cr, gtk_label_get_layout (label)); + cairo_fill (cr); + + cairo_destroy (cr); #endif gtk_paint_layout (gtk_widget_get_style (widget), diff --git a/typing-break/drw-utils.c b/typing-break/drw-utils.c index 0bf27c59..f5ed7e3f 100644 --- a/typing-break/drw-utils.c +++ b/typing-break/drw-utils.c @@ -157,14 +157,11 @@ set_pixmap_background (GtkWidget *window) { GdkScreen *screen; GdkPixbuf *tmp_pixbuf, *pixbuf, *tile_pixbuf; -#if GTK_CHECK_VERSION (3, 0, 0) - cairo_t *cr; -#else GdkPixmap *pixmap; -#endif GdkRectangle rect; GdkColor color; gint width, height; + cairo_t *cr; gtk_widget_realize (window); @@ -232,18 +229,10 @@ set_pixmap_background (GtkWidget *window) height, -1); - gdk_draw_pixbuf (pixmap, - NULL, - tmp_pixbuf, - 0, - 0, - 0, - 0, - width, - height, - GDK_RGB_DITHER_NONE, - 0, - 0); + cr = gdk_cairo_create (pixmap); + gdk_cairo_set_source_pixbuf (cr, tmp_pixbuf, 0, 0); + cairo_paint (cr); + cairo_destroy (cr); #endif g_object_unref (tmp_pixbuf); |