2010-07-31 [holger] 3.7.6cvs26
authorHolger Berndt <hb@claws-mail.org>
Sat, 31 Jul 2010 01:39:00 +0000 (01:39 +0000)
committerHolger Berndt <hb@claws-mail.org>
Sat, 31 Jul 2010 01:39:00 +0000 (01:39 +0000)
* src/gtk/gtkshruler.c
Yet more GdkGC to Cairo porting

ChangeLog
PATCHSETS
configure.ac
src/gtk/gtkshruler.c

index d5264b2..086eabc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-31 [holger]    3.7.6cvs26
+
+       * src/gtk/gtkshruler.c
+               Yet more GdkGC to Cairo porting
+
 2010-07-30 [holger]    3.7.6cvs25
 
        * src/stock_pixmap.c
index d0e0313..0c7b660 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
 ( cvs diff -u -r 1.25.2.66 -r 1.25.2.67 src/stock_pixmap.c;  ) > 3.7.6cvs25.patchset
+( cvs diff -u -r 1.1.4.12 -r 1.1.4.13 src/gtk/gtkshruler.c;  ) > 3.7.6cvs26.patchset
index 5d81f63..b34b3a6 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=25
+EXTRA_VERSION=26
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 5d10f09..66e548f 100644 (file)
@@ -115,7 +115,7 @@ static void
 gtk_shruler_draw_ticks(GtkRuler *ruler)
 {
        GtkWidget *widget;
-       GdkGC *gc, *bg_gc;
+       cairo_t *cr;
        gint i;
        gint width, height;
        gint xthickness;
@@ -130,8 +130,10 @@ gtk_shruler_draw_ticks(GtkRuler *ruler)
 
        widget = GTK_WIDGET (ruler);
        
-       gc = widget->style->fg_gc[GTK_STATE_NORMAL];
-       bg_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
+       cr = gdk_cairo_create(ruler->backing_store);
+       cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
+       cairo_set_line_width(cr, 1.);
+       gdk_cairo_set_source_color(cr, &gtk_widget_get_style(widget)->text[GTK_STATE_NORMAL]);
 
        xthickness = widget->style->xthickness;
        ythickness = widget->style->ythickness;
@@ -154,9 +156,9 @@ gtk_shruler_draw_ticks(GtkRuler *ruler)
                if ( pos % 10 == 0 ) length = ( 2 * height / 3 );
                else if ( pos % 5 == 0 ) length = ( height / 3 );
                
-               gdk_draw_line(ruler->backing_store, gc,
-                             i, height + ythickness,
-                             i, height - length);                      
+               cairo_move_to(cr, i, height + ythickness);
+               cairo_line_to(cr, i, height - length);
+               cairo_stroke(cr);
                
                if ( pos % 10 == 0 ) {
                        gchar buf[8];
@@ -168,10 +170,12 @@ gtk_shruler_draw_ticks(GtkRuler *ruler)
                        layout = gtk_widget_create_pango_layout
                                (GTK_WIDGET(ruler), buf);
 
-                       gdk_draw_layout(ruler->backing_store, gc, i + 2,
-                                       0, layout);
+                       cairo_move_to(cr, i+2, 0);
+                       pango_cairo_show_layout(cr, layout);
 
                        g_object_unref(layout);
                }
        }
+
+       cairo_destroy(cr);
 }