[gtk/matthiasc/css-values: 6/11] css: Make the common font size singletons



commit d63a729ab144d5bb928853dae9e84657d9416b8b
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 10 08:28:08 2020 -0500

    css: Make the common font size singletons

 gtk/gtkcssdimensionvalue.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gtk/gtkcssdimensionvalue.c b/gtk/gtkcssdimensionvalue.c
index c29f361c6a..0ed99339e2 100644
--- a/gtk/gtkcssdimensionvalue.c
+++ b/gtk/gtkcssdimensionvalue.c
@@ -317,6 +317,8 @@ gtk_css_dimension_value_new (double     value,
     { &GTK_CSS_VALUE_DIMENSION.value_class, 1, GTK_CSS_PX, 8 },
     { &GTK_CSS_VALUE_DIMENSION.value_class, 1, GTK_CSS_PX, 16 }, /* Icon size default */
     { &GTK_CSS_VALUE_DIMENSION.value_class, 1, GTK_CSS_PX, 32 },
+    { &GTK_CSS_VALUE_DIMENSION.value_class, 1, GTK_CSS_PX, 10 * 96.0 / 72.0 }, /* font size 10 */
+    { &GTK_CSS_VALUE_DIMENSION.value_class, 1, GTK_CSS_PX, 11 * 96.0 / 72.0 }, /* font size 11 */
   };
   static GtkCssValue percent_singletons[] = {
     { &GTK_CSS_VALUE_DIMENSION.value_class, 1, GTK_CSS_PERCENT, 0 },
@@ -364,6 +366,10 @@ gtk_css_dimension_value_new (double     value,
         return _gtk_css_value_ref (&px_singletons[9]);
       if (value == 32)
         return _gtk_css_value_ref (&px_singletons[10]);
+      if (value == 10 * 96.0 / 72.0)
+        return _gtk_css_value_ref (&px_singletons[11]);
+      if (value == 11 * 96.0 / 72.0)
+        return _gtk_css_value_ref (&px_singletons[12]);
 
       break;
 


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