13const std::vector<std::vector<std::vector<std::string>>> elements = {
15 {
"Replaced by the gauge"},
135 {
"(*----------)"}, {
"(-*---------)"}, {
"(--*--------)"},
136 {
"(---*-------)"}, {
"(----*------)"}, {
"(-----*-----)"},
137 {
"(------*----)"}, {
"(-------*---)"}, {
"(--------*--)"},
138 {
"(---------*-)"}, {
"(----------*)"}, {
"(---------*-)"},
139 {
"(--------*--)"}, {
"(-------*---)"}, {
"(------*----)"},
140 {
"(-----*-----)"}, {
"(----*------)"}, {
"(---*-------)"},
141 {
"(--*--------)"}, {
"(-*---------)"},
260 if (charset_index == 0) {
261 const int progress_size = 40;
262 image_index %= progress_size;
263 if (image_index > progress_size / 2) {
264 image_index = progress_size - image_index;
266 return gauge(
float(image_index) * 0.05F);
268 charset_index %= (int)elements.size();
269 image_index %= (int)elements[charset_index].
size();
270 std::vector<Element> lines;
271 for (
const auto& it : elements[charset_index][image_index]) {
272 lines.push_back(
text(it));
274 return vbox(std::move(lines));
std::shared_ptr< Node > Element
Element spinner(int charset_index, size_t image_index)
Useful to represent the effect of time and/or events. This display an ASCII art "video".
Element text(std::wstring text)
Display a piece of unicode text.
Decorator size(Direction, Constraint, int value)
Apply a constraint on the size of an element.
Element gauge(float progress)
Draw a high definition progress bar.
Element vbox(Elements)
A container displaying elements vertically one by one.