diff --git a/desktopenvs/hyprlua/astal-menu/ui/quadgrid.py b/desktopenvs/hyprlua/astal-menu/ui/quadgrid.py index a33aad3..355cd52 100644 --- a/desktopenvs/hyprlua/astal-menu/ui/quadgrid.py +++ b/desktopenvs/hyprlua/astal-menu/ui/quadgrid.py @@ -16,7 +16,7 @@ from __future__ import annotations import gi gi.require_version("Gtk", "4.0") -from gi.repository import Gtk # noqa: E402 +from gi.repository import GLib, Gtk # noqa: E402 from lib.border import bordered from module_base import ModuleSpec @@ -83,12 +83,19 @@ class QuadGrid(Gtk.Overlay): self._expand_holder.append(content) self._expanded_id = module_id self._expand_reveal.set_reveal_child(True) - # bouncy scale pop (CSS @keyframes); the class was cleared on collapse so - # re-adding it here replays the animation on every expand. + # bouncy scale pop (CSS @keyframes). Keep the class only for the animation's + # duration, then drop it: while it's applied, any re-layout of the card (module + # content streaming in, the grid updating underneath) restarts the transform + # animation, which made the pop loop forever. self._expand_card.add_css_class("quad-pop") + GLib.timeout_add(340, self._clear_pop) self.grid.add_css_class("dimmed") card.on_show() + def _clear_pop(self) -> bool: + self._expand_card.remove_css_class("quad-pop") + return GLib.SOURCE_REMOVE + def request_collapse(self) -> None: self._expand_reveal.set_reveal_child(False) self._expand_reveal.set_visible(False)