mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
Merge branch 'wip/alice/opacity' into 'main'
css: Allow percents in opacity See merge request GNOME/gtk!7346
This commit is contained in:
commit
888afe3e46
@ -240,9 +240,10 @@ parse_css_direction (GtkCssStyleProperty *property,
|
||||
|
||||
static GtkCssValue *
|
||||
opacity_parse (GtkCssStyleProperty *property,
|
||||
GtkCssParser *parser)
|
||||
GtkCssParser *parser)
|
||||
{
|
||||
return gtk_css_number_value_parse (parser, GTK_CSS_PARSE_NUMBER);
|
||||
return gtk_css_number_value_parse (parser, GTK_CSS_PARSE_NUMBER
|
||||
| GTK_CSS_PARSE_PERCENT);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
|
@ -11857,7 +11857,7 @@ gtk_widget_create_render_node (GtkWidget *widget,
|
||||
|
||||
style = gtk_css_node_get_style (priv->cssnode);
|
||||
|
||||
css_opacity = gtk_css_number_value_get (style->other->opacity, 100);
|
||||
css_opacity = gtk_css_number_value_get (style->other->opacity, 1);
|
||||
opacity = CLAMP (css_opacity, 0.0, 1.0) * priv->user_alpha / 255.0;
|
||||
|
||||
if (opacity <= 0.0)
|
||||
|
@ -21,3 +21,7 @@ e {
|
||||
f {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
g {
|
||||
opacity: 50%;
|
||||
}
|
||||
|
@ -21,3 +21,7 @@ e {
|
||||
f {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
g {
|
||||
opacity: 50%;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user