[libadwaita/wip/exalm/tab-style: 10/10] tab-box: Fix resize deferring with non-expanded tabs




commit 87590711353c3b01361998752aebb3427386e7ca
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.

 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 5ae901c5..a3ebcedb 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -523,6 +523,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)
@@ -3700,6 +3707,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]