Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
aurore::ThemeDecorations Class Reference

#include <aurore/core/theme_decor.hpp>

Static Public Member Functions

static void update (ThemeVariant variant)
 
static void drawBackdrop (ThemeArea area, NVGcontext *vg, float x, float y, float width, float height, float radius=0.0f)
 
static void drawStrips (NVGcontext *vg, float x, float y, float width, float height)
 
static void drawParticles (NVGcontext *vg, ParticleLayer layer, float width, float height)
 
static bool step (Time now)
 
static bool particlesRunning ()
 
static int particleCount ()
 
static bool hasPicture (ThemeArea area)
 
static void reset ()
 

Static Public Attributes

static constexpr int MAX_PARTICLES = 60
 
static constexpr int PARTICLE_FPS = 30
 
static constexpr int IDLE_SECONDS = 60
 

Detailed Description

What a theme decorates the screens with (docs/themes.md, Decorations), in the variant in use: a picture over the surface of an area (the header, the sidebar, the dialogs: View::setThemeArea), strips along the top and bottom edges of the screen, particles. Application draws them; without them nothing is drawn and nothing changes.

The particles move only when motion is allowed (Application::getReduceMotion() false: neither the app's reduced motion nor, with Cadran, its lighter or reduced visual effects or still screenshots), else nothing of them is drawn. They move at PARTICLE_FPS (with redraw on demand, the frames they ask for), and stop after IDLE_SECONDS without input (they fade out, and ask for no frame until the next input). They never take the focus, an input or a touch, and are no view: the layout does not know them.

Only the UI thread calls these.

Member Function Documentation

◆ drawBackdrop()

static void aurore::ThemeDecorations::drawBackdrop ( ThemeArea  area,
NVGcontext *  vg,
float  x,
float  y,
float  width,
float  height,
float  radius = 0.0f 
)
static

The picture of area (HEADER, SIDEBAR, DIALOG) over x, y, width, height, with corners of radius; nothing without one.

◆ drawParticles()

static void aurore::ThemeDecorations::drawParticles ( NVGcontext *  vg,
ParticleLayer  layer,
float  width,
float  height 
)
static

The particles of layer over the screen (width, height: the layout's), where they are now; nothing while they do not run.

◆ drawStrips()

static void aurore::ThemeDecorations::drawStrips ( NVGcontext *  vg,
float  x,
float  y,
float  width,
float  height 
)
static

The strips (decor.top, decor.bottom) along the edges of the screen, the part of them over x, y, width, height.

◆ hasPicture()

static bool aurore::ThemeDecorations::hasPicture ( ThemeArea  area)
static

Whether the theme in use has a strip or a backdrop picture loaded.

◆ particleCount()

static int aurore::ThemeDecorations::particleCount ( )
static

How many particles the theme in use has (0 without), running or not.

◆ particlesRunning()

static bool aurore::ThemeDecorations::particlesRunning ( )
static

Whether the particles are shown and moving now: the theme has some, motion is allowed, there was input in the last IDLE_SECONDS (and the time they take to fade out).

◆ reset()

static void aurore::ThemeDecorations::reset ( )
static

Lets go of every picture (Application::exit).

◆ step()

static bool aurore::ThemeDecorations::step ( Time  now)
static

Once per iteration of the main loop, after the input: whether the particles moved since the frame last drawn (a frame is due, with redraw on demand).

◆ update()

static void aurore::ThemeDecorations::update ( ThemeVariant  variant)
static

The theme or the variant changed (Application): the pictures of variant loaded (those of the theme before stay until they are ready), its particles set up from its colours.

Member Data Documentation

◆ IDLE_SECONDS

constexpr int aurore::ThemeDecorations::IDLE_SECONDS = 60
staticconstexpr

◆ MAX_PARTICLES

constexpr int aurore::ThemeDecorations::MAX_PARTICLES = 60
staticconstexpr

◆ PARTICLE_FPS

constexpr int aurore::ThemeDecorations::PARTICLE_FPS = 30
staticconstexpr

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