Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
BannerHost Class Reference

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>

Inheritance diagram for BannerHost:
[legend]
Collaboration diagram for BannerHost:
[legend]

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
BannerShaderConfigconfig = nullptr
GradientFallbackWidgetfallback = nullptr
QTimer clock
QElapsedTimer elapsed
Motif currentMotif = Motif::Welcome
bool usingFallback = false
bool isFirstApply = true

Detailed Description

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.

Member Enumeration Documentation

◆ Motif

enum class BannerHost::Motif
strong
Enumerator
Welcome 
CardDatabase 
Theming 
Account 
Preferences 
Finish 

Constructor & Destructor Documentation

◆ BannerHost()

BannerHost::BannerHost ( QWidget * parent = nullptr)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ activateFallback()

void BannerHost::activateFallback ( )
private
Here is the caller graph for this function:

◆ applyMotifPreset()

void BannerHost::applyMotifPreset ( Motif motif)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hideEvent()

void BannerHost::hideEvent ( QHideEvent * event)
overrideprotected

◆ onSceneGraphFailed

void BannerHost::onSceneGraphFailed ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ presetFor()

BannerHost::Preset BannerHost::presetFor ( Motif motif)
staticprivate
Here is the caller graph for this function:

◆ resizeEvent()

void BannerHost::resizeEvent ( QResizeEvent * event)
overrideprotected
Here is the call graph for this function:

◆ setMotif()

void BannerHost::setMotif ( Motif motif)
Here is the call graph for this function:

◆ showEvent()

void BannerHost::showEvent ( QShowEvent * event)
overrideprotected

◆ tick

void BannerHost::tick ( )
privateslot
Here is the caller graph for this function:

◆ updateAspect()

void BannerHost::updateAspect ( )
private
Here is the caller graph for this function:

Member Data Documentation

◆ clock

QTimer BannerHost::clock
private

◆ config

BannerShaderConfig* BannerHost::config = nullptr
private

◆ currentMotif

Motif BannerHost::currentMotif = Motif::Welcome
private

◆ elapsed

QElapsedTimer BannerHost::elapsed
private

◆ fallback

GradientFallbackWidget* BannerHost::fallback = nullptr
private

◆ isFirstApply

bool BannerHost::isFirstApply = true
private

◆ quickWidget

QQuickWidget* BannerHost::quickWidget = nullptr
private

◆ stack

QStackedLayout* BannerHost::stack
private

◆ usingFallback

bool BannerHost::usingFallback = false
private

The documentation for this class was generated from the following files: