[gtk/wip/baedert/for-master: 11/29] cssrgbavalue: Add & use new_white()



commit d2e2676e32fdbf24926869efe72e3bd3bfa81a7d
Author: Timm Bäder <mail baedert org>
Date:   Fri Aug 23 08:14:54 2019 +0200

    cssrgbavalue: Add & use new_white()

 gtk/gtkcssrgbavalue.c         | 6 ++++++
 gtk/gtkcssrgbavalueprivate.h  | 1 +
 gtk/gtkcssstylepropertyimpl.c | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkcssrgbavalue.c b/gtk/gtkcssrgbavalue.c
index ab3d180648..a63f2803a3 100644
--- a/gtk/gtkcssrgbavalue.c
+++ b/gtk/gtkcssrgbavalue.c
@@ -150,6 +150,12 @@ _gtk_css_rgba_value_new_transparent (void)
   return _gtk_css_value_ref (&transparent_black_singleton);
 }
 
+GtkCssValue *
+_gtk_css_rgba_value_new_white (void)
+{
+  return _gtk_css_value_ref (&opaque_white_singleton);
+}
+
 const GdkRGBA *
 _gtk_css_rgba_value_get_rgba (const GtkCssValue *rgba)
 {
diff --git a/gtk/gtkcssrgbavalueprivate.h b/gtk/gtkcssrgbavalueprivate.h
index 56760c275e..6a1b185b56 100644
--- a/gtk/gtkcssrgbavalueprivate.h
+++ b/gtk/gtkcssrgbavalueprivate.h
@@ -28,6 +28,7 @@ G_BEGIN_DECLS
 
 GtkCssValue *   _gtk_css_rgba_value_new_from_rgba   (const GdkRGBA          *rgba);
 GtkCssValue *   _gtk_css_rgba_value_new_transparent (void);
+GtkCssValue *   _gtk_css_rgba_value_new_white       (void);
 
 const GdkRGBA * _gtk_css_rgba_value_get_rgba      (const GtkCssValue      *rgba) G_GNUC_PURE;
 
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index af2869121b..0ebaffeaf7 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -947,7 +947,7 @@ _gtk_css_style_property_init_properties (void)
                                           GTK_CSS_AFFECTS_CONTENT | GTK_CSS_AFFECTS_SYMBOLIC_ICON,
                                           color_parse,
                                           color_query,
-                                          _gtk_css_color_value_new_rgba (1, 1, 1, 1));
+                                          _gtk_css_rgba_value_new_white ());
   gtk_css_style_property_register        ("-gtk-dpi",
                                           GTK_CSS_PROPERTY_DPI,
                                           G_TYPE_NONE,


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