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



commit c0336b8d601946fc100f7342ad237416b493fd81
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]