[gtksourceview/gnome-3-18] map: call gtk_style_context_set_state() before getting color



commit b41c5c02e8f7bf9a378af05fd430c68a5ddb19f0
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Nov 25 15:14:35 2015 +0100

    map: call gtk_style_context_set_state() before getting color
    
    There is already a save/restore.
    
    https://blogs.gnome.org/mclasen/2015/11/20/a-gtk-update/

 gtksourceview/gtksourcemap.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcemap.c b/gtksourceview/gtksourcemap.c
index 5640405..82ab7de 100644
--- a/gtksourceview/gtksourcemap.c
+++ b/gtksourceview/gtksourcemap.c
@@ -346,8 +346,11 @@ gtk_source_map_rebuild_css (GtkSourceMap *map)
                context = gtk_widget_get_style_context (GTK_WIDGET (priv->view));
                gtk_style_context_save (context);
                gtk_style_context_add_class (context, "view");
+               gtk_style_context_set_state (context, GTK_STATE_FLAG_SELECTED);
                G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-               gtk_style_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &color);
+               gtk_style_context_get_background_color (context,
+                                                       gtk_style_context_get_state (context),
+                                                       &color);
                G_GNUC_END_IGNORE_DEPRECATIONS;
                gtk_style_context_restore (context);
                background = gdk_rgba_to_string (&color);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]