feat(src/shared/widgets):add bezier_curve property and trigger animation on active

This commit is contained in:
sankalp committed 2026-06-17 04:52:09 +05:45
1 parent 32080ab17f
commit bceebd646c
2 files changed
+15

No files matched your search

+12
View File
@@ -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
+3
View File
@@ -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(