|
Aurore
A Switch-like interface for your app, on every screen
|
Namespaces | |
| namespace | kit |
| namespace | palette |
Classes | |
| class | Card |
| class | List |
| struct | PillMode |
| struct | Progress |
| class | Switch |
| struct | TimeButton |
Enumerations | |
| enum class | Tone { OK , WARN , DANGER } |
| enum class | Emphasis { NONE , PRIMARY , DANGER , FAILURE } |
Functions | |
| void | start () |
| void | start_window () |
| void | install_theme () |
| void | style_header (aurore::AppletFrame *frame, const char *icon, const std::string &text, bool filled, bool with_date) |
| void | install_screens () |
| void | style_rail (aurore::View *tab_frame) |
| void | apply_rail () |
| void | style_frame (aurore::AppletFrame *frame, aurore::View *tab_frame) |
| Both, for the main screen. | |
| bool | is_main_frame (aurore::View *frame) |
| bool | is_standalone_screen (aurore::View *frame) |
| void | set_pill (const std::string &text, const char *icon="check", Tone tone=Tone::OK) |
| void | refresh_pill () |
| The pill again after a mode changed (ui::hooks' pill, read-only). | |
| aurore::View * | make_glow (float cx, float cy, float radius, const char *color_key) |
| std::string | upper (const std::string &text) |
| void | add_note (const std::string &key, const char *icon, bool warn=false) |
| aurore::Box * | dialog_body (const std::string &text) |
| aurore::Label * | dialog_title (const std::string &text) |
| A dialog's title as dialog_body sets it (the display face, 23 px). | |
| aurore::Box * | dialog_badge (const char *icon, const char *color_key, const char *soft_key) |
A round badge before a title: icon in color_key on soft_key. | |
| void | style_dialog (aurore::Dialog *dialog, Emphasis emphasis=Emphasis::NONE) |
| void | style_edit_text_dialog (aurore::EditTextDialog *dialog) |
| void | style_button (aurore::Button *button, Emphasis emphasis=Emphasis::NONE) |
| aurore::Box * | wait_body (const std::string &text) |
| Progress | progress_body (const std::string &heading, const std::string &title, const std::string ¬e="") |
| void | prompt_time (const std::string &header, std::vector< int > times, int initial, TimeButton off, TimeButton other, std::function< void(int)> on_value) |
| aurore::View * | toast_icon (bool done) |
Variables | |
| constexpr float | DIALOG_BUTTONS = 80 |
| constexpr float | DIALOG_MARGIN = 24 |
| constexpr float | PICKER_CORNER = 24 |
| A picker's card: the radius of its corners. | |
|
strong |
|
strong |
The main screen's header pill: its text, or hidden when empty (each screen says what it has to: "Library up to date", "Play timer on"…), its icon, and its tone: amber for a state that needs the user, coral for something off that should be on. While the app writes nothing (ui::hooks' read_only), the pill says so instead, whatever the screen.
| Enumerator | |
|---|---|
| OK | |
| WARN | |
| DANGER | |
| void cadran::add_note | ( | const std::string & | key, |
| const char * | icon, | ||
| bool | warn = false |
||
| ) |
A paragraph of the app's that dialog_body() draws as a note, with icon (in amber with warn): one whose text starts as the text of the i18n key key does, up to its first "{}". The note kinds are the app's: added once at start-up.
| void cadran::apply_rail | ( | ) |
ui::prefs().rail changed (an app's Preferences › Sidebar): the main screen's rail after it, at once.
| aurore::Box * cadran::dialog_badge | ( | const char * | icon, |
| const char * | color_key, | ||
| const char * | soft_key | ||
| ) |
A round badge before a title: icon in color_key on soft_key.
| aurore::Box * cadran::dialog_body | ( | const std::string & | text | ) |
A dialog's text laid out as the boards do (ui::dialog), left-aligned: its question as a title, a paragraph made with cadran_text::table as a table (its mark says so, not its words), the notes the app adds (add_note) at the bottom, small, each with its icon; any other paragraph as text.
| aurore::Label * cadran::dialog_title | ( | const std::string & | text | ) |
A dialog's title as dialog_body sets it (the display face, 23 px).
| void cadran::install_screens | ( | ) |
From then on, every screen but the main one gets the header after the boards (the mark, the title) and its list in cards (cadran::List), the first time it takes the focus.
| void cadran::install_theme | ( | ) |
The boards' two palettes on Aurore's two variants (dark: navy; light: cool white), the rail's metrics and the display font: before any view.
| bool cadran::is_main_frame | ( | aurore::View * | frame | ) |
Whether frame is a main screen: it holds a TabFrame (or a view with the id "main_tabs"). install_screens() styles it with style_frame() the first time it takes the focus, unless the app did already.
| bool cadran::is_standalone_screen | ( | aurore::View * | frame | ) |
Whether frame is a screen of its own, not a step from the one under it (a child's screen): no "Console ›" crumb before its title, no version badge after it. The app says so with ui::hooks' standalone_screen, or by a view with the id "cadran/standalone" in the screen.
| aurore::View * cadran::make_glow | ( | float | cx, |
| float | cy, | ||
| float | radius, | ||
| const char * | color_key | ||
| ) |
The soft glow of the boards, an absolute full-screen view to add first in a frame: a radial gradient of color_key centred on (cx, cy), radius wide. Nothing with the lighter effects (cadran/ui/effects), without the glow (ui::prefs) or with AURORE_CADRAN_NOGLOW=1 (ui::env_flag).
| Progress cadran::progress_body | ( | const std::string & | heading, |
| const std::string & | title, | ||
| const std::string & | note = "" |
||
| ) |
| void cadran::prompt_time | ( | const std::string & | header, |
| std::vector< int > | times, | ||
| int | initial, | ||
| TimeButton | off, | ||
| TimeButton | other, | ||
| std::function< void(int)> | on_value | ||
| ) |
| void cadran::refresh_pill | ( | ) |
The pill again after a mode changed (ui::hooks' pill, read-only).
| void cadran::set_pill | ( | const std::string & | text, |
| const char * | icon = "check", |
||
| Tone | tone = Tone::OK |
||
| ) |
| void cadran::start | ( | ) |
Once Aurore has started (Application::init): the console's theme and language kept, the strings loaded in the preferences' language. The app sets ui::hooks and calls ui::use_prefs before.
| void cadran::start_window | ( | ) |
Once the window is there (Application::createWindow): the preferences' font and theme, the palettes, the text size, and the views and screens that take Cadran's look from then on: the footer's hints, the header's version badge and settings, every screen's header and list, and the main screen (an AppletFrame holding a TabFrame) with its rail.
| void cadran::style_button | ( | aurore::Button * | button, |
| Emphasis | emphasis = Emphasis::NONE |
||
| ) |
A button of a dialog's own, not of its row (one that must act before the dialog closes): a pill as style_dialog draws them, plain unless PRIMARY or DANGER.
| void cadran::style_dialog | ( | aurore::Dialog * | dialog, |
| Emphasis | emphasis = Emphasis::NONE |
||
| ) |
dialog as a card, its buttons as pills. Once: a dressed dialog is left as it is (every screen that takes the focus comes through here, see install_screens). Call it after the dialog's last addButton. DANGER and FAILURE also put a coral warning before a dialog_body's title.
| void cadran::style_edit_text_dialog | ( | aurore::EditTextDialog * | dialog | ) |
The desktop's text field (aurore::EditTextDialog) as a dialog's card, its title in it over the text. Once, as style_dialog (install_screens).
| void cadran::style_frame | ( | aurore::AppletFrame * | frame, |
| aurore::View * | tab_frame | ||
| ) |
Both, for the main screen.
| void cadran::style_header | ( | aurore::AppletFrame * | frame, |
| const char * | icon, | ||
| const std::string & | text, | ||
| bool | filled, | ||
| bool | with_date | ||
| ) |
A frame's header after the boards: the mark for the app icon, the title at 24, a pill at the right (icon and text; filled teal, else a bordered one) and, when asked, the date.
| void cadran::style_rail | ( | aurore::View * | tab_frame | ) |
A TabFrame's sidebar as the boards' rail: an icon before each label, the active tab on a teal pill; open, on its icons, or folding by itself as ui::prefs() says (ui::RAILS).
| aurore::View * cadran::toast_icon | ( | bool | done | ) |
A toast's icon: a check for something done, a warning for something not done.
| std::string cadran::upper | ( | const std::string & | text | ) |
"Sécurité" -> "SÉCURITÉ": ASCII, Latin-1, œ and Cyrillic (the catalogs' scripts with a case); anything else is kept.
| aurore::Box * cadran::wait_body | ( | const std::string & | text | ) |
A dialog's body while something is under way: a spinner, and what is being done under it, centred.
|
constexpr |
Under a dressed dialog's content: its button row (a 56 px pill and 24 px below), and what the card keeps from the screen's top and bottom.
|
constexpr |
|
constexpr |
A picker's card: the radius of its corners.