[gtksourceview/wip/chergert/gsv-gtk4] spacedrawer: remove deprecated API use



commit ab4582a79942aa05c21b1c42f2a4c406a136db30
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 5bda430b..f0b8cb6e 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]