[gtksourceview/wip/chergert/gsv-gtk4: 133/259] spacedrawer: remove deprecated API use
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/gsv-gtk4: 133/259] spacedrawer: remove deprecated API use
- Date: Mon, 21 Sep 2020 23:27:45 +0000 (UTC)
commit ef2a05508ca018ff38dbccc5faf65948be0677e3
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]