From fa1a8d9276ab2a13d69e0c88b0207bc5e3b12345 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 27 Sep 2016 17:21:28 -0700 Subject: [PATCH] visualizer-ticks: use color from GtkStyleContext This should improve the coloring when used with a dark theme. --- lib/sp-visualizer-ticks.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/sp-visualizer-ticks.c b/lib/sp-visualizer-ticks.c index e2eeeb6c..a1ffe83e 100644 --- a/lib/sp-visualizer-ticks.c +++ b/lib/sp-visualizer-ticks.c @@ -99,8 +99,11 @@ sp_visualizer_ticks_draw (GtkWidget *widget, cairo_t *cr) { SpVisualizerTicks *self = (SpVisualizerTicks *)widget; + GtkStyleContext *style; GtkAllocation alloc; + GtkStateFlags state; gint64 timespan; + GdkRGBA color; g_assert (SP_IS_VISUALIZER_TICKS (self)); g_assert (cr != NULL); @@ -110,7 +113,11 @@ sp_visualizer_ticks_draw (GtkWidget *widget, gtk_widget_get_allocation (GTK_WIDGET (self), &alloc); - cairo_set_source_rgba (cr, 0, 0, 0, .2); + style = gtk_widget_get_style_context (widget); + state = gtk_widget_get_state_flags (widget); + gtk_style_context_get_color (style, state, &color); + + gdk_cairo_set_source_rgba (cr, &color); /* * We need to discover up to what level we will draw tick marks.