[gtksourceview/wip/chergert/gsv-gtk4: 125/172] spacedrawer: remove deprecated API use
- From: Christian Hergert <chergert src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gtksourceview/wip/chergert/gsv-gtk4: 125/172] spacedrawer: remove deprecated API use
 
- Date: Thu, 14 May 2020 02:12:09 +0000 (UTC)
 
commit ed689053f79faba791607d54d32a5e6d3b0f5c2e
Author: Christian Hergert <chergert redhat com>
Date:   Mon Mar 16 12:05:23 2020 -0700
    spacedrawer: remove deprecated API use
    
    We no longer have access to gtk_style_context_set_state(), so instead we
    can just rely on being updated whenever the style updates and use the
    foreground color with *=.5 alpha.
 gtksourceview/gtksourcespacedrawer.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/gtksourceview/gtksourcespacedrawer.c b/gtksourceview/gtksourcespacedrawer.c
index 5864fe79..9f4793b2 100644
--- a/gtksourceview/gtksourcespacedrawer.c
+++ b/gtksourceview/gtksourcespacedrawer.c
@@ -778,15 +778,10 @@ _gtk_source_space_drawer_update_color (GtkSourceSpaceDrawer *drawer,
        if (!drawer->color_set)
        {
                GtkStyleContext *context;
-               GdkRGBA color;
 
                context = gtk_widget_get_style_context (GTK_WIDGET (view));
-               gtk_style_context_save (context);
-               gtk_style_context_set_state (context, GTK_STATE_FLAG_INSENSITIVE);
-               gtk_style_context_get_color (context, &color);
-               gtk_style_context_restore (context);
-
-               drawer->color = color;
+               gtk_style_context_get_color (context, &drawer->color);
+               drawer->color.alpha *= .5;
                drawer->color_set = TRUE;
        }
 }
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]