[libadwaita] fixes



commit 392da6aaaad347f43527aef4f2a821c49ca81f0c
Author: Manuel Genovés <manuel genoves gmail com>
Date:   Sun Jul 25 19:48:42 2021 +0200

    fixes

 src/adw-animation.c                | 68 +++++++++++++++++++++++++++-----------
 src/adw-carousel-indicator-dots.c  |  4 ---
 src/adw-carousel-indicator-lines.c |  4 ---
 src/adw-carousel.c                 |  7 ----
 src/adw-flap.c                     |  6 ----
 src/adw-preferences-window.c       |  1 -
 src/adw-tab-box.c                  | 31 -----------------
 src/adw-tab.c                      |  1 -
 8 files changed, 48 insertions(+), 74 deletions(-)
---
diff --git a/src/adw-animation.c b/src/adw-animation.c
index d33784d2..014a947f 100644
--- a/src/adw-animation.c
+++ b/src/adw-animation.c
@@ -226,7 +226,7 @@ adw_animation_class_init (AdwAnimationClass *klass)
                        "Interpolator",
                        "Easing function used in the animation",
                        ADW_TYPE_ANIMATION_INTERPOLATOR,
-                       ADW_ANIMATION_INTERPOLATOR_EASE_IN,
+                       ADW_ANIMATION_INTERPOLATOR_EASE_OUT,
                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
 
   props[PROP_TARGET] =
@@ -347,9 +347,11 @@ adw_animation_new (GtkWidget                 *widget,
 void
 adw_animation_start (AdwAnimation *self)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
+
+  g_return_if_fail (ADW_IS_ANIMATION (self));
 
-  g_return_if_fail (self != NULL);
+  priv = adw_animation_get_instance_private (self);
 
   if (!adw_get_enable_animations (priv->widget) ||
       !gtk_widget_get_mapped (priv->widget) ||
@@ -375,9 +377,11 @@ adw_animation_start (AdwAnimation *self)
 void
 adw_animation_stop (AdwAnimation *self)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
-  g_return_if_fail (self != NULL);
+  g_return_if_fail (ADW_IS_ANIMATION (self));
+
+  priv = adw_animation_get_instance_private (self);
 
   if (priv->tick_cb_id) {
     gtk_widget_remove_tick_callback (priv->widget, priv->tick_cb_id);
@@ -395,9 +399,11 @@ adw_animation_stop (AdwAnimation *self)
 double
 adw_animation_get_value (AdwAnimation *self)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
-  g_return_val_if_fail (self != NULL, 0.0);
+  g_return_val_if_fail (ADW_IS_ANIMATION (self), 0.0);
+
+  priv = adw_animation_get_instance_private (self);
 
   return priv->value;
 }
@@ -405,9 +411,11 @@ adw_animation_get_value (AdwAnimation *self)
 GtkWidget *
 adw_animation_get_widget (AdwAnimation *self)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
-  g_return_val_if_fail (self != NULL, NULL);
+  g_return_val_if_fail (ADW_IS_ANIMATION (self), NULL);
+
+  priv = adw_animation_get_instance_private (self);
 
   return priv->widget;
 }
@@ -415,49 +423,59 @@ adw_animation_get_widget (AdwAnimation *self)
 double
 adw_animation_get_value_from (AdwAnimation *self)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
   g_return_val_if_fail (ADW_IS_ANIMATION (self), 0.0);
 
+  priv = adw_animation_get_instance_private (self);
+
   return priv->value_from;
 }
 
 double
 adw_animation_get_value_to (AdwAnimation *self)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
   g_return_val_if_fail (ADW_IS_ANIMATION (self), 0.0);
 
+  priv = adw_animation_get_instance_private (self);
+
   return priv->value_to;
 }
 
 gint64
 adw_animation_get_duration (AdwAnimation *self)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
   g_return_val_if_fail (ADW_IS_ANIMATION (self), 0);
 
+  priv = adw_animation_get_instance_private (self);
+
   return priv->duration;
 }
 
 AdwAnimationInterpolator
 adw_animation_get_interpolator (AdwAnimation *self)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
   g_return_val_if_fail (ADW_IS_ANIMATION (self), ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
 
+  priv = adw_animation_get_instance_private (self);
+
   return priv->interpolator;
 }
 
 AdwAnimationTarget *
 adw_animation_get_target (AdwAnimation *self)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
-  g_return_val_if_fail (self != NULL, NULL);
+  g_return_val_if_fail (ADW_IS_ANIMATION (self), NULL);
+
+  priv = adw_animation_get_instance_private (self);
 
   return priv->target;
 }
@@ -478,10 +496,12 @@ void
 adw_animation_set_value_from (AdwAnimation *self,
                               double        value)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
   g_return_if_fail (ADW_IS_ANIMATION (self));
 
+  priv = adw_animation_get_instance_private (self);
+
   if (priv->value_from == value)
     return;
 
@@ -494,10 +514,12 @@ void
 adw_animation_set_value_to (AdwAnimation *self,
                             double        value)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
   g_return_if_fail (ADW_IS_ANIMATION (self));
 
+  priv = adw_animation_get_instance_private (self);
+
   if (priv->value_to == value)
     return;
 
@@ -510,10 +532,12 @@ void
 adw_animation_set_duration (AdwAnimation *self,
                             gint64        duration)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
   g_return_if_fail (ADW_IS_ANIMATION (self));
 
+  priv = adw_animation_get_instance_private (self);
+
   if (priv->duration == duration)
     return;
 
@@ -526,11 +550,13 @@ void
 adw_animation_set_interpolator (AdwAnimation             *self,
                                 AdwAnimationInterpolator  interpolator)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
   g_return_if_fail (ADW_IS_ANIMATION (self));
   g_return_if_fail (interpolator <= ADW_ANIMATION_INTERPOLATOR_EASE_IN_OUT);
 
+  priv = adw_animation_get_instance_private (self);
+
   if (priv->interpolator == interpolator)
     return;
 
@@ -543,11 +569,13 @@ void
 adw_animation_set_status (AdwAnimation       *self,
                           AdwAnimationStatus  status)
 {
-  AdwAnimationPrivate *priv = adw_animation_get_instance_private (self);
+  AdwAnimationPrivate *priv;
 
   g_return_if_fail (ADW_IS_ANIMATION (self));
   g_return_if_fail (status <= ADW_ANIMATION_STATUS_CANCELED);
 
+  priv = adw_animation_get_instance_private (self);
+
   if (priv->status == status)
     return;
 
diff --git a/src/adw-carousel-indicator-dots.c b/src/adw-carousel-indicator-dots.c
index f4ec4a8e..e873687b 100644
--- a/src/adw-carousel-indicator-dots.c
+++ b/src/adw-carousel-indicator-dots.c
@@ -8,7 +8,6 @@
 
 #include "adw-carousel-indicator-dots.h"
 
-#include "adw-animation-util.h"
 #include "adw-animation-util-private.h"
 #include "adw-animation-private.h"
 #include "adw-swipeable.h"
@@ -90,9 +89,6 @@ animate (AdwCarouselIndicatorDots *self,
     adw_animation_new (GTK_WIDGET (self), 0, 1, duration,
                        (AdwAnimationTargetFunc) value_cb,
                        self);
-
-  adw_animation_set_interpolator (self->animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
     
   g_signal_connect_swapped (self->animation, "done", G_CALLBACK (done_cb), self);
 
diff --git a/src/adw-carousel-indicator-lines.c b/src/adw-carousel-indicator-lines.c
index 1e360114..c01309b1 100644
--- a/src/adw-carousel-indicator-lines.c
+++ b/src/adw-carousel-indicator-lines.c
@@ -8,7 +8,6 @@
 
 #include "adw-carousel-indicator-lines.h"
 
-#include "adw-animation-util.h"
 #include "adw-animation-private.h"
 #include "adw-swipeable.h"
 
@@ -89,9 +88,6 @@ animate (AdwCarouselIndicatorLines *self,
                        (AdwAnimationTargetFunc) value_cb,
                        self);
 
-  adw_animation_set_interpolator (self->animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (self->animation, "done", G_CALLBACK (done_cb), self);
 
   adw_animation_start (self->animation);
diff --git a/src/adw-carousel.c b/src/adw-carousel.c
index 2d22cc02..c91d6171 100644
--- a/src/adw-carousel.c
+++ b/src/adw-carousel.c
@@ -8,7 +8,6 @@
 
 #include "adw-carousel.h"
 
-#include "adw-animation-util.h"
 #include "adw-animation-util-private.h"
 #include "adw-animation-private.h"
 #include "adw-navigation-direction.h"
@@ -329,9 +328,6 @@ animate_child_resize (AdwCarousel *self,
                        (AdwAnimationTargetFunc) resize_animation_value_cb,
                        child);
 
-  adw_animation_set_interpolator (child->resize_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (child->resize_animation, "done", G_CALLBACK (resize_animation_done_cb), child);
 
   adw_animation_start (child->resize_animation);
@@ -390,9 +386,6 @@ scroll_to (AdwCarousel *self,
                        (AdwAnimationTargetFunc) scroll_animation_value_cb,
                        self);
 
-  adw_animation_set_interpolator (self->animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (self->animation, "done", G_CALLBACK (scroll_animation_done_cb), self);
 
   adw_animation_start (self->animation);
diff --git a/src/adw-flap.c b/src/adw-flap.c
index 35b3c8ad..633dfe68 100644
--- a/src/adw-flap.c
+++ b/src/adw-flap.c
@@ -304,9 +304,6 @@ animate_fold (AdwFlap *self)
                        (AdwAnimationTargetFunc) fold_animation_value_cb,
                        self);
 
-  adw_animation_set_interpolator (self->fold_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (self->fold_animation, "done", G_CALLBACK (fold_animation_done_cb), self);
 
   adw_animation_start (self->fold_animation);
@@ -348,9 +345,6 @@ animate_reveal (AdwFlap *self,
                        (AdwAnimationTargetFunc) reveal_animation_value_cb,
                        self);
 
-  adw_animation_set_interpolator (self->reveal_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (self->reveal_animation, "done", G_CALLBACK (reveal_animation_done_cb), self);
 
   adw_animation_start (self->reveal_animation);
diff --git a/src/adw-preferences-window.c b/src/adw-preferences-window.c
index 4679b6a5..38477675 100644
--- a/src/adw-preferences-window.c
+++ b/src/adw-preferences-window.c
@@ -9,7 +9,6 @@
 
 #include "adw-preferences-window.h"
 
-#include "adw-animation-private.h"
 #include "adw-animation-util-private.h"
 #include "adw-action-row.h"
 #include "adw-leaflet.h"
diff --git a/src/adw-tab-box.c b/src/adw-tab-box.c
index 3c211f9f..27305aea 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -9,7 +9,6 @@
 #include "config.h"
 
 #include "adw-tab-box-private.h"
-#include "adw-animation-util.h"
 #include "adw-animation-util-private.h"
 #include "adw-animation-private.h"
 #include "adw-tab-private.h"
@@ -470,9 +469,6 @@ set_tab_resize_mode (AdwTabBox     *self,
                          resize_animation_value_cb,
                          self);
 
-    adw_animation_set_interpolator (self->resize_animation,
-                                    ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
     g_signal_connect_swapped (self->resize_animation, "done", G_CALLBACK (resize_animation_done_cb), self);
 
     adw_animation_start (self->resize_animation);
@@ -818,9 +814,6 @@ animate_scroll (AdwTabBox *self,
                        scroll_animation_value_cb,
                        self);
 
-  adw_animation_set_interpolator (self->scroll_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (self->scroll_animation, "done", G_CALLBACK (scroll_animation_done_cb), self);
 
   adw_animation_start (self->scroll_animation);
@@ -1054,9 +1047,6 @@ animate_reordering (AdwTabBox *self,
                        reorder_animation_value_cb,
                        dest_tab);
 
-  adw_animation_set_interpolator (self->reorder_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (self->reorder_animation, "done", G_CALLBACK (reorder_animation_done_cb), 
dest_tab);
 
   adw_animation_start (self->reorder_animation);
@@ -1109,9 +1099,6 @@ animate_reorder_offset (AdwTabBox *self,
                        reorder_offset_animation_value_cb,
                        info);
 
-  adw_animation_set_interpolator (info->reorder_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (info->reorder_animation, "done", G_CALLBACK (reorder_offset_animation_done_cb), 
info);
 
   adw_animation_start (info->reorder_animation);
@@ -1693,9 +1680,6 @@ page_attached_cb (AdwTabBox  *self,
                        appear_animation_value_cb,
                        info);
 
-  adw_animation_set_interpolator (info->appear_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (info->appear_animation, "done", G_CALLBACK (open_animation_done_cb), info);
 
   l = find_nth_alive_tab (self, position);
@@ -1803,9 +1787,6 @@ page_detached_cb (AdwTabBox  *self,
                        appear_animation_value_cb,
                        info);
 
-  adw_animation_set_interpolator (info->appear_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (info->appear_animation, "done", G_CALLBACK (close_animation_done_cb), info);
 
   adw_animation_start (info->appear_animation);
@@ -1999,9 +1980,6 @@ insert_placeholder (AdwTabBox  *self,
                        insert_animation_value_cb,
                        info);
 
-  adw_animation_set_interpolator (info->appear_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (info->appear_animation, "done", G_CALLBACK (open_animation_done_cb), info);
 
   adw_animation_start (info->appear_animation);
@@ -2051,9 +2029,6 @@ replace_placeholder (AdwTabBox  *self,
                        appear_animation_value_cb,
                        info);
 
-  adw_animation_set_interpolator (info->appear_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (info->appear_animation, "done", G_CALLBACK (replace_animation_done_cb), info);
 
   adw_animation_start (info->appear_animation);
@@ -2127,9 +2102,6 @@ remove_placeholder (AdwTabBox *self)
                        appear_animation_value_cb,
                        info);
 
-  adw_animation_set_interpolator (info->appear_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (info->appear_animation, "done", G_CALLBACK (remove_animation_done_cb), info);
 
   adw_animation_start (info->appear_animation);
@@ -2353,9 +2325,6 @@ resize_drag_icon (AdwTabBox *self,
                        icon_resize_animation_value_cb,
                        icon);
 
-  adw_animation_set_interpolator (icon->resize_animation,
-                                  ADW_ANIMATION_INTERPOLATOR_EASE_OUT);
-
   g_signal_connect_swapped (icon->resize_animation, "done", G_CALLBACK (icon_resize_animation_done_cb), 
icon);
 
   adw_animation_start (icon->resize_animation);
diff --git a/src/adw-tab.c b/src/adw-tab.c
index 12a029d6..557c1b31 100644
--- a/src/adw-tab.c
+++ b/src/adw-tab.c
@@ -9,7 +9,6 @@
 #include "config.h"
 #include "adw-tab-private.h"
 
-#include "adw-animation-util.h"
 #include "adw-animation-util-private.h"
 #include "adw-animation-private.h"
 #include "adw-bidi-private.h"


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