mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 12:41:07 +00:00
css: Support colors in cross fades
The CSS Image Spec (Level 4) allows colors in cross-fade expressions to specify solid-color images. Support this.
This commit is contained in:
parent
25409c5a5a
commit
5ee7606779
@ -218,7 +218,7 @@ done with
|
|||||||
|background-size| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-size) | |
|
|background-size| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-size) | |
|
||||||
|background-position| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-position) | |
|
|background-position| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-position) | |
|
||||||
|background-repeat| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-repeat) | |
|
|background-repeat| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-repeat) | |
|
||||||
|background-image| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-image) | not supported: urls without quotes, colors in crossfades |
|
|background-image| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background-image) | not supported: urls without quotes |
|
||||||
|box-shadow| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#box-shadow) | |
|
|box-shadow| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#box-shadow) | |
|
||||||
|background-blend-mode| [CSS Compositing and Blending Level 1](https://www.w3.org/TR/compositing-1/#propdef-background-blend-mode) | only affects multiple backgrounds |
|
|background-blend-mode| [CSS Compositing and Blending Level 1](https://www.w3.org/TR/compositing-1/#propdef-background-blend-mode) | only affects multiple backgrounds |
|
||||||
|background| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background) | |
|
|background| [CSS Backgrounds and Borders Level 3](https://www.w3.org/TR/css3-background/#background) | |
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
#include "gtkcssimagecrossfadeprivate.h"
|
#include "gtkcssimagecrossfadeprivate.h"
|
||||||
|
|
||||||
#include "gtkcssnumbervalueprivate.h"
|
#include "gtkcssnumbervalueprivate.h"
|
||||||
|
#include "gtkcssimagefallbackprivate.h"
|
||||||
|
#include "gtkcsscolorvalueprivate.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct _CrossFadeEntry CrossFadeEntry;
|
typedef struct _CrossFadeEntry CrossFadeEntry;
|
||||||
|
|
||||||
@ -308,8 +311,19 @@ parse_image (GtkCssParser *parser,
|
|||||||
{
|
{
|
||||||
GtkCssImage **image = option_data;
|
GtkCssImage **image = option_data;
|
||||||
|
|
||||||
|
if (_gtk_css_image_can_parse (parser))
|
||||||
*image = _gtk_css_image_new_parse (parser);
|
*image = _gtk_css_image_new_parse (parser);
|
||||||
if (*image == NULL)
|
else if (gtk_css_color_value_can_parse (parser))
|
||||||
|
{
|
||||||
|
GtkCssValue *color;
|
||||||
|
|
||||||
|
color = _gtk_css_color_value_parse (parser);
|
||||||
|
if (color == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
*image = _gtk_css_image_fallback_new_for_color (color);
|
||||||
|
}
|
||||||
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -325,7 +339,7 @@ gtk_css_image_cross_fade_parse_arg (GtkCssParser *parser,
|
|||||||
GtkCssImage *image = NULL;
|
GtkCssImage *image = NULL;
|
||||||
GtkCssParseOption options[] =
|
GtkCssParseOption options[] =
|
||||||
{
|
{
|
||||||
{ (void *) gtk_css_number_value_can_parse, parse_progress, &progress },
|
{ (void *)gtk_css_number_value_can_parse, parse_progress, &progress },
|
||||||
{ NULL, parse_image, &image },
|
{ NULL, parse_image, &image },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user