diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2012-04-06 17:41:00 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2012-04-06 17:41:00 +0000 |
| commit | e7c6906dfd496f02786ef57099629f7e6940f225 (patch) | |
| tree | 2b897c07c7f8b42c8a6a09448fa07f352bd5b04a /src/widgets/sp-color-slider.cpp | |
| parent | Fix remaining GTKMM deprecation issues (diff) | |
| download | inkscape-e7c6906dfd496f02786ef57099629f7e6940f225.tar.gz inkscape-e7c6906dfd496f02786ef57099629f7e6940f225.zip | |
drop some deprecated gdk_draw functions
(bzr r11166)
Diffstat (limited to 'src/widgets/sp-color-slider.cpp')
| -rw-r--r-- | src/widgets/sp-color-slider.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/widgets/sp-color-slider.cpp b/src/widgets/sp-color-slider.cpp index 17a33affe..b74be502b 100644 --- a/src/widgets/sp-color-slider.cpp +++ b/src/widgets/sp-color-slider.cpp @@ -585,30 +585,40 @@ sp_color_slider_paint (SPColorSlider *slider, GdkRectangle *area) if (gdk_rectangle_intersect (area, &aarea, &apaint)) { /* Draw arrow */ gdk_rectangle_intersect (&carea, &apaint, &apaint); - gdk_gc_set_clip_rectangle(style->white_gc, &apaint); - gdk_gc_set_clip_rectangle(style->black_gc, &apaint); + cairo_t* cr = gdk_cairo_create(window); + gdk_cairo_rectangle(cr, &apaint); + cairo_clip(cr); x = aarea.x; y1 = carea.y; y2 = aarea.y + aarea.height - 1; w = aarea.width; + cairo_set_line_width(cr, 1.0); + while ( w > 0 ) { - gdk_draw_line(window, style->white_gc, x, y1, x + w - 1, y1 ); - gdk_draw_line(window, style->white_gc, x, y2, x + w - 1, y2 ); + gdk_cairo_set_source_color(cr, &style->white); + cairo_move_to(cr, x - 0.5, y1 + 0.5); + cairo_line_to(cr, x + w - 1 + 0.5, y1 + 0.5); + cairo_move_to(cr, x - 0.5, y2 + 0.5); + cairo_line_to(cr, x + w - 1 + 0.5, y2 + 0.5); + cairo_stroke(cr); w -=2; x++; if ( w > 0 ) { - gdk_draw_line(window, style->black_gc, x, y1, x + w - 1, y1 ); - gdk_draw_line(window, style->black_gc, x, y2, x + w - 1, y2 ); + gdk_cairo_set_source_color(cr, &style->black); + cairo_move_to(cr, x - 0.5, y1 + 0.5); + cairo_line_to(cr, x + w - 1 + 0.5, y1 + 0.5); + cairo_move_to(cr, x - 0.5, y2 + 0.5); + cairo_line_to(cr, x + w - 1 + 0.5, y2 + 0.5); + cairo_stroke(cr); } y1++; y2--; } - gdk_gc_set_clip_rectangle(style->white_gc, NULL); - gdk_gc_set_clip_rectangle(style->black_gc, NULL); + cairo_destroy(cr); } } |
