[gtk+] gtkstylecontext: Optimize GtkStyleContext usage
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtkstylecontext: Optimize GtkStyleContext usage
- Date: Thu, 27 Nov 2014 02:11:42 +0000 (UTC)
commit 9c7a5f5efafaa01ccc57a82cc4619f433cbda699
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Nov 26 18:10:29 2014 -0800
gtkstylecontext: Optimize GtkStyleContext usage
gtk/gtkstylecontext.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 3745804..8205ec8 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3255,14 +3255,18 @@ G_GNUC_END_IGNORE_DEPRECATIONS
}
else
{
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, color);
+ GtkStateFlags state;
+
+ state = gtk_style_context_get_state (context);
+
+ gtk_style_context_get_color (context, state, color);
if (!primary)
{
GdkRGBA bg;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg);
+ gtk_style_context_get_background_color (context, state, &bg);
G_GNUC_END_IGNORE_DEPRECATIONS
color->red = (color->red + bg.red) * 0.5;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]