![]() |
Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
|
Onboarding banner: a subtle, looping brand-shader animation, one of six per-page "motifs" driving the same prebaked fragment shader (onboarding/shaders/brand_banner.frag) with different uniform values, so every page feels distinct but unmistakably part of the same family. More...
#include <shader_banner_widget.h>
Classes | |
| struct | Preset |
Public Types | |
| enum class | Motif { Welcome , CardDatabase , Theming , Account , Preferences , Finish } |
Public Member Functions | |
| BannerHost (QWidget *parent=nullptr) | |
| void | setMotif (Motif motif) |
Protected Member Functions | |
| void | showEvent (QShowEvent *event) override |
| void | hideEvent (QHideEvent *event) override |
| void | resizeEvent (QResizeEvent *event) override |
Private Slots | |
| void | tick () |
| void | onSceneGraphFailed () |
Private Member Functions | |
| void | applyMotifPreset (Motif motif) |
| void | updateAspect () |
| void | activateFallback () |
Static Private Member Functions | |
| static Preset | presetFor (Motif motif) |
Private Attributes | |
| QStackedLayout * | stack |
| QQuickWidget * | quickWidget = nullptr |
| BannerShaderConfig * | config = nullptr |
| GradientFallbackWidget * | fallback = nullptr |
| QTimer | clock |
| QElapsedTimer | elapsed |
| Motif | currentMotif = Motif::Welcome |
| bool | usingFallback = false |
| bool | isFirstApply = true |
Onboarding banner: a subtle, looping brand-shader animation, one of six per-page "motifs" driving the same prebaked fragment shader (onboarding/shaders/brand_banner.frag) with different uniform values, so every page feels distinct but unmistakably part of the same family.
Motif switches crossfade smoothly (see BrandBanner.qml's two stacked ShaderEffect layers + Behavior on opacity) rather than cutting instantly – BannerHost just writes the new preset into whichever layer is currently hidden and flips BannerShaderConfig::frontIsA; QML handles the actual animation declaratively.
Falls back to a static two-stop gradient (no shader, no QQuickWidget) if the platform's Qt Quick scenegraph can't initialize – e.g. software rendering only, or a CI/VM environment with no GPU – so onboarding never blocks or blanks out over a graphics driver problem. The fallback is permanent for the lifetime of this widget once triggered.
|
strong |
|
explicit |
|
private |
|
private |
|
overrideprotected |
|
privateslot |
|
staticprivate |
|
overrideprotected |
| void BannerHost::setMotif | ( | Motif | motif | ) |
|
overrideprotected |
|
privateslot |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |