diff options
author | Timm Bäder <mail@baedert.org> | 2020-01-10 13:02:33 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-01-18 08:49:51 +0100 |
commit | 67991ed0f405eca73e4c2f78f3e0d1c6c1a8de2c (patch) | |
tree | 96ffafb8af8006940199f547fadc7266cb147daf /gtk/gtkcssshadowvalue.c | |
parent | 741e12012dcee880d72fd292b62c4d8d5b7dd276 (diff) | |
download | gtk+-67991ed0f405eca73e4c2f78f3e0d1c6c1a8de2c.tar.gz |
Remove GtkCssRgbaValue
The differenciation between a literal color value and an RGBA value
caused problems in various situations. Just treat the two the same but
don't allow access to the rgba value of a non-literal color value.
This gets rid of around 1.6k rgba values in the widget-factory.
Diffstat (limited to 'gtk/gtkcssshadowvalue.c')
-rw-r--r-- | gtk/gtkcssshadowvalue.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c index 79a2950b8e..709aff4023 100644 --- a/gtk/gtkcssshadowvalue.c +++ b/gtk/gtkcssshadowvalue.c @@ -23,7 +23,7 @@ #include "gtkcsscolorvalueprivate.h" #include "gtkcssnumbervalueprivate.h" -#include "gtkcssrgbavalueprivate.h" +#include "gtkcsscolorvalueprivate.h" #include "gtksnapshotprivate.h" #include "gtkstylecontextprivate.h" #include "gtkpango.h" @@ -197,7 +197,7 @@ _gtk_css_shadow_value_new_for_transition (GtkCssValue *target) _gtk_css_number_value_new (0, GTK_CSS_PX), _gtk_css_number_value_new (0, GTK_CSS_PX), target->inset, - _gtk_css_rgba_value_new_transparent ()); + gtk_css_color_value_new_transparent ()); } enum { @@ -360,7 +360,7 @@ void gtk_css_shadow_value_get_shadow (const GtkCssValue *value, GskShadow *shadow) { - shadow->color = *_gtk_css_rgba_value_get_rgba (value->color); + shadow->color = *gtk_css_color_value_get_rgba (value->color); shadow->dx = _gtk_css_number_value_get (value->hoffset, 0); shadow->dy = _gtk_css_number_value_get (value->voffset, 0); shadow->radius = _gtk_css_number_value_get (value->radius, 0); @@ -374,12 +374,12 @@ gtk_css_shadow_value_snapshot_outset (const GtkCssValue *shadow, g_return_if_fail (shadow->class == >K_CSS_VALUE_SHADOW); /* We don't need to draw invisible shadows */ - if (gdk_rgba_is_clear (_gtk_css_rgba_value_get_rgba (shadow->color))) + if (gdk_rgba_is_clear (gtk_css_color_value_get_rgba (shadow->color))) return; gtk_snapshot_append_outset_shadow (snapshot, border_box, - _gtk_css_rgba_value_get_rgba (shadow->color), + gtk_css_color_value_get_rgba (shadow->color), _gtk_css_number_value_get (shadow->hoffset, 0), _gtk_css_number_value_get (shadow->voffset, 0), _gtk_css_number_value_get (shadow->spread, 0), @@ -397,14 +397,14 @@ gtk_css_shadow_value_snapshot_inset (const GtkCssValue *shadow, g_return_if_fail (shadow->class == >K_CSS_VALUE_SHADOW); /* We don't need to draw invisible shadows */ - if (gdk_rgba_is_clear (_gtk_css_rgba_value_get_rgba (shadow->color))) + if (gdk_rgba_is_clear (gtk_css_color_value_get_rgba (shadow->color))) return; dx = _gtk_css_number_value_get (shadow->hoffset, 0); dy = _gtk_css_number_value_get (shadow->voffset, 0); spread = _gtk_css_number_value_get (shadow->spread, 0); radius = _gtk_css_number_value_get (shadow->radius, 0); - color = _gtk_css_rgba_value_get_rgba (shadow->color); + color = gtk_css_color_value_get_rgba (shadow->color); /* These are trivial to do with a color node */ if (spread == 0 && radius == 0 && @@ -470,6 +470,6 @@ gtk_css_shadow_value_snapshot_inset (const GtkCssValue *shadow, gboolean gtk_css_shadow_value_is_clear (const GtkCssValue *shadow) { - return gdk_rgba_is_clear (_gtk_css_rgba_value_get_rgba (shadow->color)); + return gdk_rgba_is_clear (gtk_css_color_value_get_rgba (shadow->color)); } |