[gtksourceview/wip/css-adjustments: 2/2] map: call gtk_style_context_set_state() before getting color
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/css-adjustments: 2/2] map: call gtk_style_context_set_state() before getting color
- Date: Wed, 25 Nov 2015 14:16:36 +0000 (UTC)
commit dd6f1c2ada58a2a4ce515db89ff6c4793b29b4c6
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 f8513fa..25ff201 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]