[gtk/wip/baedert/css-values: 100/102] widget: Get opacity without GtkStyleContext
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/css-values: 100/102] widget: Get opacity without GtkStyleContext
- Date: Sat, 18 Jan 2020 07:53:51 +0000 (UTC)
commit f8fa946989dae8fb513ad9891de00aae720a8791
Author: Timm Bäder <mail baedert org>
Date: Thu Jan 16 13:17:35 2020 +0100
widget: Get opacity without GtkStyleContext
GtkStyleContext is really just unnecessary here.
gtk/gtkwidget.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 2744ba6c90..77cdb6b8da 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10830,15 +10830,14 @@ static void
gtk_widget_update_alpha (GtkWidget *widget)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
- GtkStyleContext *context;
gdouble opacity;
guint8 alpha;
- context = _gtk_widget_get_style_context (widget);
- opacity =
- _gtk_css_number_value_get (_gtk_style_context_peek_property (context,
- GTK_CSS_PROPERTY_OPACITY),
- 100);
+ opacity = _gtk_css_number_value_get (gtk_css_style_get_value (gtk_css_node_get_style (priv->cssnode),
+ GTK_CSS_PROPERTY_OPACITY),
+ 100);
+
+
opacity = CLAMP (opacity, 0.0, 1.0);
alpha = round (priv->user_alpha * opacity);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]