Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
loading_bar.hpp
Go to the documentation of this file.
1// LoadingBar — a progress bar that eases: the loading screen's (a rounded navy
2// track, filled in the brand teal up to the start-up step reached), and a
3// screen's while its list loads, in the theme's colours. The fill eases to each
4// new value instead of jumping (the next step's frames show it moving), or,
5// for the intro, fills at a steady pace over a given time. On the loading
6// screen, the brand's colours (cadran/brand/…), the same in both themes.
7// Copyright (C) 2026 JigSawFr. GPLv3-or-later (see LICENSE.GPL).
8#pragma once
9
10#include <aurore.hpp>
11
14{
15 public:
17
19 void setProgress(float value);
21 void fillOver(float value, aurore::Time duration_us);
23 void reset();
26 void setBrand(bool on) { this->brand = on; }
27
28 void draw(NVGcontext* vg, float x, float y, float width, float height,
29 aurore::Style style, aurore::FrameContext* ctx) override;
30
32
33 private:
34 void moveTo(float value, float duration_us, bool at_steady_pace);
35 float drawn(aurore::Time now) const;
36
37 float from = 0.0f, to = 0.0f;
38 aurore::Time since = 0;
39 float duration = 0.0f;
40 bool steady = false;
41 bool brand = false;
42};
A progress bar that eases to each new value (the loading screen's, a list's).
Definition loading_bar.hpp:14
void reset()
Empty again at once (a bar shown anew, not easing back down).
void fillOver(float value, aurore::Time duration_us)
Fills to value at a steady pace, over duration_us.
void setBrand(bool on)
Definition loading_bar.hpp:26
void draw(NVGcontext *vg, float x, float y, float width, float height, aurore::Style style, aurore::FrameContext *ctx) override
void setProgress(float value)
0..1: how much of the start-up is done.
static aurore::View * create()
Definition frame_context.hpp:30
Simple wrapper around StyleValues for the array operator.
Definition style.hpp:115
Definition view.hpp:232
retro_time_t Time
Definition time.hpp:31