mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 05:31:07 +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
@ -242,7 +242,8 @@ static GtkCssValue *
|
||||
opacity_parse (GtkCssStyleProperty *property,
|
||||
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