[gtk/css-line-height] css fixes



commit 4a5025eca10318468c162c096eda36a73fe936ab
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Aug 6 16:40:54 2021 -0400

    css fixes

 gtk/gtkcssstringvalue.c        | 10 ++++++++++
 gtk/gtkcssstringvalueprivate.h |  1 +
 gtk/gtkcssstylepropertyimpl.c  |  2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkcssstringvalue.c b/gtk/gtkcssstringvalue.c
index b72427de11..b6915ba804 100644
--- a/gtk/gtkcssstringvalue.c
+++ b/gtk/gtkcssstringvalue.c
@@ -226,3 +226,13 @@ _gtk_css_ident_value_get (const GtkCssValue *value)
   return value->string;
 }
 
+GtkCssValue *
+gtk_css_line_height_value_get_default (void)
+{
+  static GtkCssValue *normal_line_height;
+
+  if (normal_line_height == NULL)
+    normal_line_height = _gtk_css_ident_value_new_take ("normal");
+
+  return normal_line_height;
+}
diff --git a/gtk/gtkcssstringvalueprivate.h b/gtk/gtkcssstringvalueprivate.h
index 8645077cd0..5c342065c5 100644
--- a/gtk/gtkcssstringvalueprivate.h
+++ b/gtk/gtkcssstringvalueprivate.h
@@ -40,6 +40,7 @@ GtkCssValue *   _gtk_css_string_value_parse         (GtkCssParser           *par
 
 const char *    _gtk_css_string_value_get           (const GtkCssValue      *string);
 
+GtkCssValue *   gtk_css_line_height_value_get_default (void);
 
 G_END_DECLS
 
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index fbe9cb8c30..d0e3b741f4 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -1425,5 +1425,5 @@ _gtk_css_style_property_init_properties (void)
                                           GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
                                           GTK_CSS_AFFECTS_TEXT_SIZE,
                                           parse_line_height,
-                                          _gtk_css_ident_value_new ("normal"));
+                                          _gtk_css_value_ref (gtk_css_line_height_value_get_default ()));
 }


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