From 7dad927f21deb2ea9b2edec3e2118d457b746d4c Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Fri, 3 Jul 2026 20:52:56 +0545 Subject: [PATCH] feat(src/shared/window): add animate parameter to control scroll animation --- src/shared/window/animated_scrollwindow.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/shared/window/animated_scrollwindow.py b/src/shared/window/animated_scrollwindow.py index 1621ba9..5dd844b 100644 --- a/src/shared/window/animated_scrollwindow.py +++ b/src/shared/window/animated_scrollwindow.py @@ -1,3 +1,4 @@ +from fabric.utils import idle_add from fabric.widgets.scrolledwindow import ScrolledWindow from shared.widgets.animator import Animator @@ -8,10 +9,12 @@ class AnimatedScrollable(ScrolledWindow): self, bezier_curve: tuple[float, float, float, float] = (0.25, 0.1, 0.25, 1.0), duration: float = 0.3, + animate: bool = True, **kwargs, ): super().__init__(**kwargs) self._last_req = -1 + self.animate = animate _, min_height = self.min_content_size _, max_height = self.max_content_size @@ -58,6 +61,9 @@ class AnimatedScrollable(ScrolledWindow): return def animate_size(self, height: int = -1): + if not self.animate: + idle_add(lambda: self.snap_to_size(height)) + return self._last_req = height current_val = self.height_animator.value return self.do_animate(current_val, height)