Namespace
ui
Namespaces 1
ui::hooksNamespace
Classes 3
ui::CheckLineA line of checklist_body().ui::ChoiceA list of things to do, as a sheet (ui/action_sheet.cpp): each line's label, and what it runs once the sheet has closed; its icon (a Cadran icon, nullptr: none), what is set…ui::PrefsWhat the user chose for Cadran's look.
Functions 70
The language and theme pickers, shared by Preferences and the main screen's header: save the choice (ui::prefs, through hooks::get().save_prefs) and apply it at once (a language makes every screen again, live_prefs; a theme or the text size runs after, a refresh). language_name / theme_name: the choice saved, as text; text_size_name, language_name and theme_name their shorter words on a tile (Preferences). The theme picker ends with the palette's row, which opens pick_palette: the boards' colours, Aurore's presets (aurore::Theme:: builtinThemes) or the user's theme files (ui::hooks' themes_dir); palette_name, the one saved (ui::Prefs::theme_file), by its name.
The language and theme pickers, shared by Preferences and the main screen's header: save the choice (ui::prefs, through hooks::get().save_prefs) and apply it at once (a language makes every screen again, live_prefs; a theme or the text size runs after, a refresh). language_name / theme_name: the choice saved, as text; text_size_name, language_name and theme_name their shorter words on a tile (Preferences). The theme picker ends with the palette's row, which opens pick_palette: the boards' colours, Aurore's presets (aurore::Theme:: builtinThemes) or the user's theme files (ui::hooks' themes_dir); palette_name, the one saved (ui::Prefs::theme_file), by its name.
The language and theme pickers, shared by Preferences and the main screen's header: save the choice (ui::prefs, through hooks::get().save_prefs) and apply it at once (a language makes every screen again, live_prefs; a theme or the text size runs after, a refresh). language_name / theme_name: the choice saved, as text; text_size_name, language_name and theme_name their shorter words on a tile (Preferences). The theme picker ends with the palette's row, which opens pick_palette: the boards' colours, Aurore's presets (aurore::Theme:: builtinThemes) or the user's theme files (ui::hooks' themes_dir); palette_name, the one saved (ui::Prefs::theme_file), by its name.
The language and theme pickers, shared by Preferences and the main screen's header: save the choice (ui::prefs, through hooks::get().save_prefs) and apply it at once (a language makes every screen again, live_prefs; a theme or the text size runs after, a refresh). language_name / theme_name: the choice saved, as text; text_size_name, language_name and theme_name their shorter words on a tile (Preferences). The theme picker ends with the palette's row, which opens pick_palette: the boards' colours, Aurore's presets (aurore::Theme:: builtinThemes) or the user's theme files (ui::hooks' themes_dir); palette_name, the one saved (ui::Prefs::theme_file), by its name.
The language and theme pickers, shared by Preferences and the main screen's header: save the choice (ui::prefs, through hooks::get().save_prefs) and apply it at once (a language makes every screen again, live_prefs; a theme or the text size runs after, a refresh). language_name / theme_name: the choice saved, as text; text_size_name, language_name and theme_name their shorter words on a tile (Preferences). The theme picker ends with the palette's row, which opens pick_palette: the boards' colours, Aurore's presets (aurore::Theme:: builtinThemes) or the user's theme files (ui::hooks' themes_dir); palette_name, the one saved (ui::Prefs::theme_file), by its name.
The language and theme pickers, shared by Preferences and the main screen's header: save the choice (ui::prefs, through hooks::get().save_prefs) and apply it at once (a language makes every screen again, live_prefs; a theme or the text size runs after, a refresh). language_name / theme_name: the choice saved, as text; text_size_name, language_name and theme_name their shorter words on a tile (Preferences). The theme picker ends with the palette's row, which opens pick_palette: the boards' colours, Aurore's presets (aurore::Theme:: builtinThemes) or the user's theme files (ui::hooks' themes_dir); palette_name, the one saved (ui::Prefs::theme_file), by its name.
The main screen's sidebar (ui::Prefs::rail): open, on its icons, or folding by itself; applied at once (cadran::apply_rail). rail_name: the choice saved, as text.
ui.hpp:288The main screen's sidebar (ui::Prefs::rail): open, on its icons, or folding by itself; applied at once (cadran::apply_rail). rail_name: the choice saved, as text.
ui.hpp:289How close the screens' pieces stand (ui::Prefs::density): automatic, comfortable, compact or dense; the screens built again at once (live_prefs::density_changed). density_name: the choice saved, as text.
ui.hpp:295How close the screens' pieces stand (ui::Prefs::density): automatic, comfortable, compact or dense; the screens built again at once (live_prefs::density_changed). density_name: the choice saved, as text.
ui.hpp:296The language and the theme saved, as text (shorter on a tile).
ui.hpp:300The language and the theme saved, as text (shorter on a tile).
ui.hpp:301Pops the sheet (a fade), then runs then (if any) on the next frame.
aurore::Box * sheet_outside(float width, bool grow) Room around the panel, width wide or taking what is left (grow): a touch there closes the sheet.
"0 min", "45 min", "2 h", "2 h 30"
format_text.hpp:14rounded to minutes, as fmt_minutes
format_text.hpp:15"0 min", "< 1 min", "45 min", "52 h 30", "278 h" (no 24 h cap)
format_text.hpp:160 = Sunday, as a title ("Monday")
format_text.hpp:17inside a sentence (fr: "lundi")
format_text.hpp:18"Yes" / "No"
format_text.hpp:20The value of a line that opens a screen of its own (or another tab), with a chevron after it: "12 changes ›", or "›" alone. A line that asks first, in a dialog, ends its title with "…" instead; one that acts at once, neither.
format_text.hpp:24template <typename F>auto guarded(Weak alive, F fn) fn(args…), or nothing once alive is gone or false. Converts to the std::function a flow takes, whatever its arguments.
Prefs & prefs() The ones in use: the app's (use_prefs), else defaults of their own.
prefs.hpp:46void use_prefs(Prefs &p) From now on, prefs() is p, which must outlive every screen.
A flag of the environment, through ui::hooks::get().env_flag (its comment says which).
prefs.hpp:52On the console: the default font of the labels made from now on, for the strings' language locale: the system's Latin / Japanese font, the Chinese one only as a fallback; for Chinese, the Chinese one. Right after createWindow(), before the first label exists, then again when the language changes while the app runs (live_prefs, which builds the screens again).
void notify(const std::string &text, Toast kind = Toast::Info) A toast of kind. Deferred to the next frame (toasts fired right after a system applet returns were dropped on fw 22.1.0).
Something asked that was not done, and why, as a Refused toast (its warning icon): a refusal is said and gone, a failure is a dialog (error).
ui.hpp:49A failure the user asked for something and did not get: a dialog, not a toast (a toast is gone before "error 0x…" is read). Next frame, so it can be called from a dialog button. Logged as "error: " for the smoke test.
ui.hpp:53what failed because of why (a path, a message from the network…).
void show_failure(const cadran_text::Failure &f) The dialog the three open, now: the title, the reason, the code small, and Send a report (OK focused) when f.report.
void replace_screen(aurore::Activity *next) next in place of the current screen. Aurore never pops the first activity (the loading screen, under every start screen): a screen that cannot be popped gets next pushed over it instead.
void confirm( const std::string &body,const std::string &confirm_label,std::function< void()> on_yes,std::function< void()> on_no = nullptr,bool danger = false)Two-button dialog. Cancel (left) has the focus when it opens; confirm_label (right) runs on_yes, Cancel or B runs on_no. danger: the confirm button is drawn in the "bad" colour (see below).
void confirm_danger( const std::string &body,const std::string &confirm_label,std::function< void()> on_yes)Same, for actions that delete something: the confirm button is drawn in the "bad" colour so it never looks like an ordinary OK.
ui.hpp:70A web page to open on a phone: body, the QR code of url, then url itself, shortened (text::short_url), and OK.
aurore::Box * check_row(const CheckLine &line, float size = 17) One of them: the mark, then the text (size px).
aurore::Box * checklist_body( const std::string &title,const std::vector< CheckLine > &lines,const std::string ¬e = "",const std::string &subtitle = "")Under title (and subtitle), the lines in rounded panels, one per Header line (its name small above it); note with an info icon last.
void notice( const char *icon,Check tone,const std::string &title,const std::string &text)A dialog that only says something: a badge (icon in tone's colour), title, text, OK.
void hold_confirm( aurore::Box *body,const std::string &hold_label,std::function< void()> on_yes,std::function< void()> on_no = nullptr)body with Cancel and hold_label: A (or a finger) held on it for 2 s, the button filling meanwhile, runs on_yes; let go sooner, it empties and nothing happens. For what is hard to undo from the console. The dialog says how itself (hold_hint, the A key for a controller): body need not.
aurore::Dialog * dialog(const std::string &text) A dialog showing text, laid out by cadran::dialog_body (its question as the title, its tables, its notes), the caller adding its buttons; a text taller than the dialog's room scrolls.
aurore::Dialog * dialog(const std::string &text, aurore::View *below) The same with below under the text, the card's width unless it aligns itself: a QR code, a code to read out, the cards to support the app.
aurore::Dialog * box_dialog(aurore::Box *body) The same for a body already laid out (a checklist, a sheet): as it is, or in a scrolling frame when taller than the dialog's room.
ui.hpp:118void on_cancel( aurore::Dialog *dialog,std::function< void()> on_cancel)B closes dialog and runs on_cancel (Aurore's own B only closes it).
void add_cancel(aurore::Dialog *dialog, std::function< void()> cancel) A Cancel button and B, both closing dialog and running cancel: a dialog that waits for something (a check, an answer from the network).
void pick( const std::string &title,const std::vector< std::string > &values,int selected,std::function< void(int)> on_pick,bool checked = true,const std::vector< std::string > &details = {},const std::vector< std::string > &icons = {},const std::vector< Swatch > &swatches = {})A list of values, as a sheet (ui/action_sheet.cpp); on_pick(index) runs after it has closed. The row selected has the focus and is checked as the current value, unless checked is false (a list of things to do, not of values). details, when given, says more about each row, after its label and quieter; icons, what goes before each row's label: a Cadran icon's name ("moon"), or a picture (a resource, "img/…png", drawn as it is); empty: none. swatches, when given, a sample of colours in the icon's place instead, for the rows it has (a palette's, as pick_palette() shows them): its background in a rounded square, its ring inside, its motif (a Cadran icon's name) in its ink, a hairline of the theme's cadran/line around it (CadranSwatch).
void pick_grid( const std::string &title,const std::vector< std::string > &values,const std::vector< std::string > &icons,int selected,std::function< void(int)> on_pick,int columns = 4)The same as tiles, columns to a row, each its Cadran icon (icons, a name) large above its label: a few values that read better side by side (the tabs of Start on).
void pick_marked( const std::string &title,const std::vector< std::string > &values,const std::vector< bool > &marks,int focus,std::function< void(int)> on_pick,const std::vector< std::string > &details = {})The same with several rows checked: those marks sets (true). Choosing a row closes the list as pick() does: to toggle one, the caller opens it again with the row's mark changed and the focus on it (focus).
void pick_actions( const std::string &title,const std::vector< Choice > &choices,const std::string &subtitle = "",int image = 0)The sheet of choices (see Choice) under title.
bool is_sheet(aurore::View *view) The sheet those open: its view, on top of the activities' stack.
ui.hpp:198void prompt_text( const std::string &header,const std::string &initial,int max_len,std::function< void(std::string)> on_value)The system keyboard for a text. The callback only on confirm.
ui.hpp:201void show_writable( aurore::DetailCell *cell,bool writable,const char *title_key = "cadran/text",const char *detail_key = "cadran/text2")An action that writes stays visible when the app cannot write (a read-only mode), greyed (title and value), so the user sees what exists. title_key / detail_key: the theme colours when writable. A BooleanCell gets its own colours back from its state.
void set_visible(aurore::View *view, bool visible) Hides a view when visible is false (Visibility::GONE frees its space). When the hidden view had the focus, the focus moves to the nearest visible focusable sibling (the next one on a tie), so it never lands on the list container or jumps far away.
void set_visible_all( std::initializer_list< std::pair< aurore::View *, bool > > changes)Applies several visibility changes, showing views before hiding others, so a cell that replaces the focused one (Unlock -> Lock now) is there to take the focus.
ui.hpp:220void set_text(aurore::Label *label, const std::string &text) A label's text, or a cell's detail, set only when it changes: Aurore lays the whole screen out again on every setText, and the tabs that refresh themselves every few seconds mostly write the same values back.
ui.hpp:225void batch_layout(aurore::Box *box, const std::function< void()> &fill) Runs fill, which adds many views to box (or changes them), with the box out of the screen's layout, then lays the screen out once. Aurore lays the whole screen out again on each addView and setText: a list of n rows built in place cost n layouts of the whole screen, n of them on screen.
void keep_focus( aurore::Activity *activity,aurore::View *fallback = nullptr)For an activity's onResume(): Aurore then gives the focus back to the view that opened the dialog (or screen) just closed, and gives none when that view was hidden meanwhile; the focus would stay on the closed dialog's button, deleted after its animation, and no button answer any more. In that case only, fallback (else the activity's first focusable view) gets it first.
bool has_focus(aurore::Activity *activity) Whether activity has the focus: nothing (a dialog, another screen) is open over it. Unlike the top of Aurore's stack, true again as soon as a dialog over it starts closing.
bool on_top(aurore::Activity *activity) Whether activity is the top of Aurore's stack: no screen or dialog pushed over it, one closing included.
aurore::Activity * main_screen() The main screen, wherever it is in the stack; nullptr before it opens.
ui.hpp:250Shows its tab position (ui::tab) and focuses its content: the view with id row when given and shown, else its first one. Nothing before it opens.
Re-reads the tab on screen, if any (after the read-only or developer mode changed, the language or the text size).
ui.hpp:256void go_to_tab(aurore::View *from, int position) Opens another tab of the main screen and focuses its first item. from is any view inside the current tab; the switch happens on the next frame because the current tab is deleted by it.
void open_screen(aurore::View *content, const std::string &title) content (a tab's view, such as the network clock) on a screen of its own, over the current one, titled title; B closes it.
− on the main screen: a list of the two, each opening its picker.
ui.hpp:304Saves ui::prefs() through hooks::get().save_prefs: false when it cannot be saved at all.
ui.hpp:308Enums 2
What a toast says: news (plain), something done (a check), or something not done because of how things are (a warning); the icon in the Cadran look.
| Value |
|---|
Info |
Done |
Refused |
A list of checks in a dialog: each line with its mark (a teal check for what is ready, an amber or coral triangle for what is not, a grey dot for what is only said), under title, note small at the end (may be empty).
| Value | Description |
|---|---|
Ok | |
Warn | |
Bad | |
Info | |
Header | not a check: the name of the panel of lines after it |
Types 3
The token a screen's late callbacks check: it goes with the screen (or is set to false, for a screen that closes before it is freed).
guarded.hpp:20What a background task holds of it: the task never keeps the screen's token, it wraps with it the callback it hands to aurore::sync.
guarded.hpp:23using Swatch = CadranSwatch::ColorsA row's colours in pick()'s swatches (CadranSwatch).
Variables 6
Read from Aurore's headers by Doxygen at each build · library/include