[gtksourceview] map: fix opacity of slider



commit 2bf18a5bdac1843c7b82cb2d30f4785596b8a7ac
Author: Christian Hergert <chergert redhat com>
Date:   Fri Dec 3 13:11:25 2021 -0800

    map: fix opacity of slider
    
    Now that the style schemes often have translucent selections we need to
    ensure we are working with an opaque color before applying opacity for
    the slider.

 gtksourceview/gtksourcemap.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/gtksourceview/gtksourcemap.c b/gtksourceview/gtksourcemap.c
index 61c96dcd..50b4b982 100644
--- a/gtksourceview/gtksourcemap.c
+++ b/gtksourceview/gtksourcemap.c
@@ -409,6 +409,8 @@ gtk_source_map_rebuild_css (GtkSourceMap *map)
 
        if (background != NULL)
        {
+               GdkRGBA parsed;
+
                if (foreground == NULL)
                {
                        GtkStyleContext *style_context;
@@ -419,6 +421,16 @@ gtk_source_map_rebuild_css (GtkSourceMap *map)
                        foreground = gdk_rgba_to_string (&color);
                }
 
+               if (gdk_rgba_parse (&parsed, background))
+               {
+                       if (parsed.alpha < 1.0)
+                       {
+                               parsed.alpha = 1.0;
+                               g_free (background);
+                               background = gdk_rgba_to_string (&parsed);
+                       }
+               }
+
                g_string_append_printf (gstr,
                                        "slider {"
                                        " background-color: alpha(%s,.25);"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]