diff --git a/src/shared/widgets/animator.py b/src/shared/widgets/animator.py index 96b8a94..36f93ac 100644 --- a/src/shared/widgets/animator.py +++ b/src/shared/widgets/animator.py @@ -84,6 +84,18 @@ class Animator(Service): @Signal def finished(self) -> None: ... + @Property(tuple[float, float, float, float], "read-write") + def bezier_curve(self) -> tuple[float, float, float, float]: + return self._bezier_curve + + @bezier_curve.setter + def bezier_curve(self, value: tuple[float, float, float, float]): + self._bezier_curve = value + self._timing_function = lambda progress=0.0, **_: cubic_bezier( + *value, progress=progress + ) + return + @Property(TimingFunctionCallback, "read-write") def timing_function(self) -> TimingFunctionCallback: return self._timing_function diff --git a/src/shared/widgets/smooth_switch.py b/src/shared/widgets/smooth_switch.py index d97a45a..30be208 100644 --- a/src/shared/widgets/smooth_switch.py +++ b/src/shared/widgets/smooth_switch.py @@ -55,6 +55,9 @@ class SmoothSwitch(Gtk.DrawingArea): max_value=1.0, tick_widget=self, ) + if active: + self._animator.value = 1.0 + self._animator.connect("notify::value", lambda *_: self.queue_draw()) self.add_events(