[gnome-builder] terminal: get state from GtkStyleContext



commit 488ec3f9b335832686e31b9b83716386790e958c
Author: Christian Hergert <chergert redhat com>
Date:   Mon Dec 14 18:34:24 2015 -0800

    terminal: get state from GtkStyleContext
    
    Fixes some warnings on gtk 3.19.x

 plugins/terminal/gb-terminal-view.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plugins/terminal/gb-terminal-view.c b/plugins/terminal/gb-terminal-view.c
index 8c57a05..1031a9f 100644
--- a/plugins/terminal/gb-terminal-view.c
+++ b/plugins/terminal/gb-terminal-view.c
@@ -59,7 +59,8 @@ static const GdkRGBA solarized_palette[] =
   { 0.992156, 0.964705, 0.890196, 1 },
 };
 
-static void gb_terminal_view_connect_terminal    (GbTerminalView *self, VteTerminal *terminal);
+static void gb_terminal_view_connect_terminal (GbTerminalView *self,
+                                               VteTerminal *terminal);
 
 static void
 gb_terminal_respawn (GbTerminalView *self,
@@ -320,15 +321,18 @@ static void
 style_context_changed (GtkStyleContext *style_context,
                        GbTerminalView  *self)
 {
+  GtkStateFlags state;
   GdkRGBA fg;
   GdkRGBA bg;
 
   g_assert (GTK_IS_STYLE_CONTEXT (style_context));
   g_assert (GB_IS_TERMINAL_VIEW (self));
 
-  gtk_style_context_get_color (style_context, GTK_STATE_FLAG_NORMAL, &fg);
+  state = gtk_style_context_get_state (style_context);
+
   G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  gtk_style_context_get_background_color (style_context, GTK_STATE_FLAG_NORMAL, &bg);
+  gtk_style_context_get_color (style_context, state, &fg);
+  gtk_style_context_get_background_color (style_context, state, &bg);
   G_GNUC_END_IGNORE_DEPRECATIONS;
 
   if (bg.alpha == 0.0)


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