refactor(kde): make qt_curve an extension trait

AnimationStyle is going to live in komorebi-protocol, and an inherent impl cannot be written outside the crate that defines the type (orphan rule). qt_curve (the only inherent impl on a type that moves in step 2, in any tree) becomes the trait QtCurve in core::animation, implemented for AnimationStyle; callers import it. The method is no longer const (trait methods cannot be); no caller needed that. Doc links to AnimationStyle::qt_curve are updated.

Verified: cargo test -p komorebi --lib every_style: passed; cargo test -p komorebi --doc: 45 + 2 passed, 0 failed (includes the qt_curve doctest).
This commit is contained in:
LGUG2Z committed 2026-10-31 01:37:53 -07:00
1 parent a617723fea
commit 163eff4216
4 files changed
+16 -6

No files matched your search

+1 -1
View File
@@ -485,7 +485,7 @@ resize, and what the window shows does not change.
Because KWin animates with `QEasingCurve`, and a style is a curve KWin has when it is Qt's name
without the "Ease": `EaseInOutSine` is `InOutSine`
([`AnimationStyle::qt_curve`](../../komorebi/src/core/animation.rs)). A custom cubic Bézier is not
([`QtCurve::qt_curve`](../../komorebi/src/core/animation.rs)). A custom cubic Bézier is not
one of Qt's curves, and is drawn as an ease out, the kind of curve a window moving to its place
wants. The stock Geometry Change has one curve, an exponential ease out, so komorebi's build of
it reads a `Curve` setting ([PLATFORM.md](PLATFORM.md#the-patches)).