Pass-through ISurfaceAnimator — calls onComplete() synchronously. More...
#include <PhosphorLayer/defaults/NoOpSurfaceAnimator.h>
Public Member Functions | |
| NoOpSurfaceAnimator ()=default | |
| ~NoOpSurfaceAnimator () override=default | |
| void | beginShow (Surface *, QQuickItem *, CompletionCallback onComplete) override |
Begin a show transition for surface. | |
| void | beginHide (Surface *, QQuickItem *, CompletionCallback onComplete) override |
Begin a hide transition for surface. | |
| void | cancel (Surface *) override |
Interrupt every in-flight animation for surface, on any item, not only the root. | |
| Public Member Functions inherited from PhosphorLayer::ISurfaceAnimator | |
| ISurfaceAnimator ()=default | |
| virtual | ~ISurfaceAnimator ()=default |
Additional Inherited Members | |
| Public Types inherited from PhosphorLayer::ISurfaceAnimator | |
| using | CompletionCallback = std::function<void()> |
| Invoked when a show/hide animation completes. | |
Pass-through ISurfaceAnimator — calls onComplete() synchronously.
This is the implicit default when a consumer doesn't provide an animator. Handing it to SurfaceFactory::Deps is equivalent to leaving the animator field nullptr; the class exists so consumers that want an explicit "no animation" contract can opt in.
Rationale: 99% of layer-shell consumers animate in QML (Behavior on opacity { … }), which happens independently of this interface. The ISurfaceAnimator hook exists for cases QML can't cover (pre-show measurement, orchestrated multi-surface transitions).
|
default |
|
overridedefault |
|
inlineoverridevirtual |
Begin a hide transition for surface.
The Surface is transitioning Shown → Hidden. The animator should fade/slide the content, then invoke onComplete. The library does not delay window->hide() waiting for this — the current contract is "animate for visual polish, but the surface is considered hidden
the moment hide() is called".
Not dispatched for a surface whose SurfaceConfig::animateRoot is false.
Implements PhosphorLayer::ISurfaceAnimator.
|
inlineoverridevirtual |
Begin a show transition for surface.
The Surface has just become visible (Hidden → Shown), or is being re-shown while already Shown, which replays the transition. The animator can mutate rootItem (opacity, scale, y-offset) and drive an animation. Invoke onComplete when the transition finishes; the library uses this as a no-op today but a future version may defer compositor sync until the completion signal arrives.
Not dispatched for a surface whose SurfaceConfig::animateRoot is false. cancel() still is, except on a re-show of a Shown surface.
Implements PhosphorLayer::ISurfaceAnimator.
|
inlineoverridevirtual |
Interrupt every in-flight animation for surface, on any item, not only the root.
Called when the Surface is destroyed, on every Shown → Hidden hide, and on every show() before its beginShow. Under SurfaceConfig::animateRoot=false a re-show of a Shown surface skips it, since there is no root leg to supersede.
Implements PhosphorLayer::ISurfaceAnimator.