[gnome-builder/wip/chergert/perspective] terminal: get state from GtkStyleContext
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/chergert/perspective] terminal: get state from GtkStyleContext
- Date: Tue, 15 Dec 2015 02:37:04 +0000 (UTC)
commit 5c3781c1b2aa4fbce42b0e01b9d468db239a063d
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 4623f8e..1346a94 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]