[gtksourceview/wip/css-adjustments] StyleScheme: save/restore StyleContext when getting color
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/css-adjustments] StyleScheme: save/restore StyleContext when getting color
- Date: Wed, 25 Nov 2015 14:27:46 +0000 (UTC)
commit 38cb888716e9fc2c5748768a54b9c75538190c7d
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Nov 25 15:25:22 2015 +0100
StyleScheme: save/restore StyleContext when getting color
gtksourceview/gtksourcestylescheme.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcestylescheme.c b/gtksourceview/gtksourcestylescheme.c
index eaeab3c..a3861c7 100644
--- a/gtksourceview/gtksourcestylescheme.c
+++ b/gtksourceview/gtksourcestylescheme.c
@@ -674,11 +674,16 @@ get_cursors_css_style (GtkSourceStyleScheme *scheme,
context = gtk_widget_get_style_context (widget);
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, GTK_STATE_FLAG_NORMAL);
+
gtk_style_context_get (context,
- GTK_STATE_FLAG_NORMAL,
+ gtk_style_context_get_state (context),
"background-color", &rgba,
NULL);
+ gtk_style_context_restore (context);
+
/* shade the secondary cursor */
secondary_color.red = rgba->red * 0.5;
secondary_color.green = rgba->green * 0.5;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]