|
Aurore
A Switch-like interface for your app, on every screen
|
#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 |
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.
|
static |
The picture of area (HEADER, SIDEBAR, DIALOG) over x, y, width, height, with corners of radius; nothing without one.
|
static |
The particles of layer over the screen (width, height: the layout's), where they are now; nothing while they do not run.
|
static |
The strips (decor.top, decor.bottom) along the edges of the screen, the part of them over x, y, width, height.
|
static |
Whether the theme in use has a strip or a backdrop picture loaded.
|
static |
How many particles the theme in use has (0 without), running or not.
|
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).
|
static |
Lets go of every picture (Application::exit).
|
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).
|
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.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |