talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit a0fbbfd7ae698d8139c1a900cfacbad7d17e110a
parent d82730d464a55a9a9a277b0cddff16945e0bc7e1
Author: Holger Berndt <hb@claws-mail.org>
Date:   Fri, 30 Jul 2010 17:01:46 +0000

2010-07-30 [holger]	3.7.6cvs24

	* src/gtk/colorlabel.c
		One GdkGC usage less

Diffstat:
MChangeLog | 5+++++
MPATCHSETS | 1+
Mconfigure.ac | 2+-
Msrc/gtk/colorlabel.c | 25+++++++++++++------------
4 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,8 @@ +2010-07-30 [holger] 3.7.6cvs24 + + * src/gtk/colorlabel.c + One GdkGC usage less + 2010-07-29 [holger] 3.7.6cvs23 * src/printing.c diff --git a/PATCHSETS b/PATCHSETS @@ -4019,3 +4019,4 @@ ( cvs diff -u -r 1.36.2.185 -r 1.36.2.186 src/common/utils.c; ) > 3.7.6cvs21.patchset ( cvs diff -u -r 1.36.2.186 -r 1.36.2.187 src/common/utils.c; ) > 3.7.6cvs22.patchset ( cvs diff -u -r 1.1.2.29 -r 1.1.2.30 src/printing.c; ) > 3.7.6cvs23.patchset +( cvs diff -u -r 1.2.2.29 -r 1.2.2.30 src/gtk/colorlabel.c; ) > 3.7.6cvs24.patchset diff --git a/configure.ac b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=7 MICRO_VERSION=6 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=23 +EXTRA_VERSION=24 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/gtk/colorlabel.c b/src/gtk/colorlabel.c @@ -194,23 +194,24 @@ static gboolean colorlabel_drawing_area_expose_event_cb GdkDrawable *drawable = widget->window; gulong c = (gulong) GPOINTER_TO_INT(data); GdkColor color; - GdkGC *gc; + cairo_t *cr; INTCOLOR_TO_GDKCOLOR(c, color) gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &color, FALSE, TRUE); - gc = gdk_gc_new(drawable); - - gdk_gc_set_foreground(gc, &color); - gdk_draw_rectangle(drawable, widget->style->black_gc, - FALSE, 0, 0, widget->allocation.width - 1, - widget->allocation.height - 1); - gdk_draw_rectangle(drawable, gc, - TRUE, 1, 1, widget->allocation.width - 2, - widget->allocation.height - 2); - - g_object_unref(gc); + cr = gdk_cairo_create(drawable); + cairo_set_source_rgb(cr, 0., 0., 0.); + cairo_rectangle(cr, 0, 0, + widget->allocation.width - 1, + widget->allocation.height - 1); + cairo_stroke(cr); + gdk_cairo_set_source_color(cr, &color); + cairo_rectangle(cr, 1, 1, + widget->allocation.width - 2, + widget->allocation.height - 2); + cairo_fill(cr); + cairo_destroy(cr); return FALSE; }