[gtksourceview] style: fix setting of bold



commit 4344dab755598b8d6858a20897718668391aae7f
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 19 15:16:48 2022 -0800

    style: fix setting of bold
    
    This was broken by the introduction of the weight attribute and this commit
    restores usefulness of bold="true".

 gtksourceview/gtksourcestyle.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/gtksourceview/gtksourcestyle.c b/gtksourceview/gtksourcestyle.c
index 0660397e..9246a225 100644
--- a/gtksourceview/gtksourcestyle.c
+++ b/gtksourceview/gtksourcestyle.c
@@ -603,7 +603,11 @@ gtk_source_style_apply (const GtkSourceStyle *style,
                        g_object_set (tag, "style-set", FALSE, NULL);
                }
 
-               if (style->mask & GTK_SOURCE_STYLE_USE_BOLD)
+               if (style->mask & GTK_SOURCE_STYLE_USE_WEIGHT)
+               {
+                       g_object_set (tag, "weight", style->weight, NULL);
+               }
+               else if (style->mask & GTK_SOURCE_STYLE_USE_BOLD)
                {
                        g_object_set (tag, "weight", style->bold ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL, 
NULL);
                }
@@ -686,15 +690,6 @@ gtk_source_style_apply (const GtkSourceStyle *style,
                        g_object_set (tag, "scale-set", FALSE, NULL);
                }
 
-               if (style->mask & GTK_SOURCE_STYLE_USE_WEIGHT)
-               {
-                       g_object_set (tag, "weight", style->weight, NULL);
-               }
-               else
-               {
-                       g_object_set (tag, "weight-set", FALSE, NULL);
-               }
-
                g_object_thaw_notify (G_OBJECT (tag));
        }
        else


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