[libadwaita/libadwaita-1-0] tab-box: Fix resize deferring with non-expanded tabs



commit 5298f4c649f2a18db9f5fa03f7c012b0883c52c6
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Thu Apr 7 02:30:19 2022 +0400

    tab-box: Fix resize deferring with non-expanded tabs
    
    This bit was lost at some point.
    
    
    (cherry picked from commit 87590711353c3b01361998752aebb3427386e7ca)
    
    (cherry picked from commit e0a892501fb5fecf5a1a65e8f1e6383e350fc588)

 src/adw-tab-box.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/adw-tab-box.c b/src/adw-tab-box.c
index f7ee1c14..c508bcbb 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -431,6 +431,13 @@ resize_animation_value_cb (double     value,
   gtk_widget_queue_resize (GTK_WIDGET (self));
 }
 
+static void
+resize_animation_done_cb (AdwTabBox *self)
+{
+  self->end_padding = 0;
+  gtk_widget_queue_resize (GTK_WIDGET (self));
+}
+
 static void
 set_tab_resize_mode (AdwTabBox     *self,
                      TabResizeMode  mode)
@@ -3494,6 +3501,9 @@ adw_tab_box_init (AdwTabBox *self)
     adw_timed_animation_new (GTK_WIDGET (self), 0, 1,
                              RESIZE_ANIMATION_DURATION, target);
 
+  g_signal_connect_swapped (self->resize_animation, "done",
+                            G_CALLBACK (resize_animation_done_cb), self);
+
   /* The actual update will be done in size_allocate(). After the animation
    * finishes, don't remove it right away, it will be done in size-allocate as
    * well after one last update, so that we don't miss the last frame.


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