Commit 484f223c authored by Christian Hergert's avatar Christian Hergert
Browse files

Revert "Stop using deprecated gtk_style_context_get_*color() functions"

This reverts commit a012c9ef.
parent e35abfce
Pipeline #271938 canceled with stages
in 41 minutes and 21 seconds
......@@ -297,14 +297,19 @@ static void
style_context_changed (GtkStyleContext *style_context,
IdeTerminalPage *self)
{
GtkStateFlags state;
GdkRGBA fg;
GdkRGBA bg;
g_assert (GTK_IS_STYLE_CONTEXT (style_context));
g_assert (IDE_IS_TERMINAL_PAGE (self));
gtk_style_context_lookup_color (style_context, "theme_text_color", &fg);
gtk_style_context_lookup_color (style_context, "text_view_bg", &bg);
state = gtk_style_context_get_state (style_context);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
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)
gdk_rgba_parse (&bg, "#f6f7f8");
......
......@@ -95,14 +95,19 @@ static void
style_context_changed (IdeTerminal *self,
GtkStyleContext *style_context)
{
GtkStateFlags state;
GdkRGBA fg;
GdkRGBA bg;
g_assert (GTK_IS_STYLE_CONTEXT (style_context));
g_assert (IDE_IS_TERMINAL (self));
gtk_style_context_lookup_color (style_context, "theme_text_color", &fg);
gtk_style_context_lookup_color (style_context, "text_view_bg", &bg);
state = gtk_style_context_get_state (style_context);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
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)
gdk_rgba_parse (&bg, "#f6f7f8");
......
......@@ -277,8 +277,10 @@ viewport_style_changed_cb (GbpGladePage *self,
g_assert (GBP_IS_GLADE_PAGE (self));
g_assert (GTK_IS_STYLE_CONTEXT (style_context));
gtk_style_context_lookup_color (style_context, "theme_fg_color", &fg);
gtk_style_context_lookup_color (style_context, "theme_base_color", &bg);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_style_context_get_color (style_context, GTK_STATE_FLAG_NORMAL, &fg);
gtk_style_context_get_background_color (style_context, GTK_STATE_FLAG_NORMAL, &bg);
G_GNUC_END_IGNORE_DEPRECATIONS;
ide_page_set_primary_color_bg (IDE_PAGE (self), &bg);
ide_page_set_primary_color_fg (IDE_PAGE (self), &fg);
......
......@@ -140,6 +140,7 @@ gbp_ls_page_style_updated (GtkWidget *widget)
{
GbpLsPage *self = (GbpLsPage *)widget;
GtkStyleContext *style_context;
GtkStateFlags state;
GdkRGBA bg, fg;
g_assert (GBP_IS_LS_PAGE (self));
......@@ -148,9 +149,12 @@ gbp_ls_page_style_updated (GtkWidget *widget)
GTK_WIDGET_CLASS (gbp_ls_page_parent_class)->style_updated (widget);
style_context = gtk_widget_get_style_context (GTK_WIDGET (self->tree_view));
state = gtk_style_context_get_state (style_context);
gtk_style_context_lookup_color (style_context, "theme_fg_color", &fg);
gtk_style_context_lookup_color (style_context, "theme_base_color", &bg);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_style_context_get_color (style_context, state, &fg);
gtk_style_context_get_background_color (style_context, state, &bg);
G_GNUC_END_IGNORE_DEPRECATIONS;
ide_page_set_primary_color_bg (IDE_PAGE (self), &bg);
ide_page_set_primary_color_fg (IDE_PAGE (self), &fg);
......
......@@ -385,7 +385,9 @@ static void
reload_style_colors (GbpOmniGutterRenderer *self,
GtkSourceStyleScheme *scheme)
{
GtkStyleContext *context;
GtkTextView *view;
GtkStateFlags state;
GdkRGBA fg;
GdkRGBA bg;
......@@ -396,8 +398,12 @@ reload_style_colors (GbpOmniGutterRenderer *self,
if (view == NULL)
return;
get_style_rgba (scheme, "line-numbers", FOREGROUND, &fg);
get_style_rgba (scheme, "line-numbers", BACKGROUND, &bg);
context = gtk_widget_get_style_context (GTK_WIDGET (view));
state = gtk_style_context_get_state (context);
gtk_style_context_get_color (context, state, &fg);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_style_context_get_background_color (context, state, &bg);
G_GNUC_END_IGNORE_DEPRECATIONS;
/* Extract common values from style schemes. */
if (!get_style_rgba (scheme, "line-numbers", FOREGROUND, &self->text.fg))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment