summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-11-27 23:31:10 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-11-27 23:31:10 +0000
commit083e48b0f1e09b0f9056c6cda5a6f344a457583b (patch)
tree03521f8104cbe3e849ba6165901ffbafaa2777ca /src/widgets
parentGerman translation 100% (diff)
downloadinkscape-083e48b0f1e09b0f9056c6cda5a6f344a457583b.tar.gz
inkscape-083e48b0f1e09b0f9056c6cda5a6f344a457583b.zip
GTK+ 3: Migrate to GdkRGBA
(bzr r11910)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/ruler.cpp7
-rw-r--r--src/widgets/sp-color-slider.cpp13
2 files changed, 20 insertions, 0 deletions
diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp
index 72c839b19..5104d5a9d 100644
--- a/src/widgets/ruler.cpp
+++ b/src/widgets/ruler.cpp
@@ -690,7 +690,14 @@ static void sp_ruler_real_draw_pos(SPRuler *ruler,
y = ROUND ((priv->position - priv->lower) * increment) + (ythickness - bs_height) / 2 - 1;
}
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkStyleContext *sc = gtk_widget_get_style_context(widget);
+ GdkRGBA color;
+ gtk_style_context_get_color(sc, gtk_widget_get_state_flags(widget), &color);
+ gdk_cairo_set_source_rgba(cr, &color);
+#else
gdk_cairo_set_source_color(cr, &style->fg[gtk_widget_get_state(widget)]);
+#endif
cairo_move_to (cr, x, y);
diff --git a/src/widgets/sp-color-slider.cpp b/src/widgets/sp-color-slider.cpp
index 37b9e022a..3ba748f2b 100644
--- a/src/widgets/sp-color-slider.cpp
+++ b/src/widgets/sp-color-slider.cpp
@@ -648,13 +648,22 @@ static gboolean sp_color_slider_draw(GtkWidget *widget, cairo_t *cr)
gint w = ARROW_SIZE;
cairo_set_line_width(cr, 1.0);
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkRGBA white = {1,1,1,1};
+ GdkRGBA black = {0,0,0,1};
+#else
GdkColor white, black;
gdk_color_parse("#fff", &white);
gdk_color_parse("#000", &black);
+#endif
while ( w > 0 )
{
+#if GTK_CHECK_VERSION(3,0,0)
+ gdk_cairo_set_source_rgba(cr, &white);
+#else
gdk_cairo_set_source_color(cr, &white);
+#endif
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);
@@ -664,7 +673,11 @@ static gboolean sp_color_slider_draw(GtkWidget *widget, cairo_t *cr)
x++;
if ( w > 0 )
{
+#if GTK_CHECK_VERSION(3,0,0)
+ gdk_cairo_set_source_rgba(cr, &black);
+#else
gdk_cairo_set_source_color(cr, &black);
+#endif
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);