[gtk/wip/baedert/transforms6: 61/61] Add & use GTK_CSS_AFFECTS_TRANSFORM



commit 33dbf2d0489a57717bfb6ed5c433129ea3251458
Author: Timm Bäder <mail baedert org>
Date:   Wed Jan 23 17:42:03 2019 +0100

    Add & use GTK_CSS_AFFECTS_TRANSFORM

 gtk/gtkcssstylepropertyimpl.c | 2 +-
 gtk/gtkcsstypesprivate.h      | 4 +++-
 gtk/gtkwidget.c               | 5 +++++
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index fe0a33701d..935737f174 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -1605,7 +1605,7 @@ _gtk_css_style_property_init_properties (void)
                                           GTK_CSS_PROPERTY_TRANSFORM,
                                           G_TYPE_NONE,
                                           GTK_STYLE_PROPERTY_ANIMATED,
-                                          GTK_CSS_AFFECTS_SIZE,
+                                          GTK_CSS_AFFECTS_TRANSFORM,
                                           transform_value_parse,
                                           NULL,
                                           _gtk_css_transform_value_new_none ());
diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h
index d6e95526c9..925c794e06 100644
--- a/gtk/gtkcsstypesprivate.h
+++ b/gtk/gtkcsstypesprivate.h
@@ -115,6 +115,7 @@ typedef guint64 GtkCssChange;
  * @GTK_CSS_AFFECTS_POSTEFFECT: An effect is applied after drawing that changes
  * @GTK_CSS_AFFECTS_TEXT: Affects anything related to text rendering.
  * @GTK_CSS_AFFECTS_REDRAW: Affects anything that requires redraw.
+ * @GTK_CSS_AFFECTS_TRANSFORM: Affects the element transformation.
  *
  * The generic effects that a CSS property can have. If a value is
  * set, then the property will have an influence on that feature.
@@ -133,7 +134,8 @@ typedef enum {
   GTK_CSS_AFFECTS_SYMBOLIC_ICON = (1 << 8),
   GTK_CSS_AFFECTS_OUTLINE       = (1 << 9),
   GTK_CSS_AFFECTS_SIZE          = (1 << 10),
-  GTK_CSS_AFFECTS_POSTEFFECT    = (1 << 11)
+  GTK_CSS_AFFECTS_POSTEFFECT    = (1 << 11),
+  GTK_CSS_AFFECTS_TRANSFORM     = (1 << 12),
 } GtkCssAffects;
 
 #define GTK_CSS_AFFECTS_REDRAW (GTK_CSS_AFFECTS_CONTENT |       \
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 21991dface..98000d00b8 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5505,6 +5505,11 @@ gtk_widget_real_style_updated (GtkWidget *widget)
             {
               gtk_widget_queue_resize (widget);
             }
+          else if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TRANSFORM) &&
+                   priv->parent != NULL)
+            {
+                gtk_widget_queue_allocate (priv->parent);
+            }
           else if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_REDRAW) ||
                    (has_text && gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT_CONTENT)))
             {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]