Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
cadran::kit Namespace Reference

Classes

class  Bar
 
class  Chip
 
struct  Empty
 
class  Mark
 

Functions

NVGcolor color (const char *key)
 
aurore::Label * label (const std::string &text, float size, const char *color_key="cadran/text")
 
aurore::Label * display (const std::string &text, float size, const char *color_key="cadran/text")
 
CadranIcon * icon (const char *name, float size, const char *color_key="cadran/text2")
 An icon of the boards, size px square.
 
aurore::Box * card (bool focusable, bool grow)
 
aurore::Box * top_card (bool grow)
 
void set_kicker (aurore::Label *label, const std::string &text="")
 
aurore::Box * kicker (const char *icon_name, const std::string &title)
 A kicker with an icon before it, in a card: an icon and a title in capitals.
 
aurore::Box * pill (const std::string &text, const char *dot_key)
 
aurore::Box * key (const char *letter, float size=24)
 
aurore::Box * qr (const std::string &payload, float side, const std::string &title, const std::string &caption, float width=0)
 
aurore::Box * chip (const std::string &text, float height=48)
 
Empty empty (const char *icon_name)
 
aurore::Box * empty_around (aurore::Label *label, const char *icon_name)
 
void wrap (aurore::View *row)
 
void fit_button (aurore::Button *button)
 
void fit_head (aurore::Box *row)
 
void draw_more_below (NVGcontext *vg, aurore::ScrollingFrame *frame, float x, float y, float width, float height, const char *color_key, float corner=0.0f)
 
std::string without_chevron (const std::string &value)
 "12 changes ›" -> "12 changes"; "›" -> "".
 
const char * dot_of (NVGcolor value_color)
 
std::string long_date ()
 
std::string long_date (const std::string &ymd)
 

Variables

constexpr float RADIUS_ROW = 14
 
constexpr float RADIUS_ICON = 12
 
constexpr float RADIUS_CARD = 20
 
constexpr float RADIUS_TOP = 22
 
constexpr float RADIUS_MODAL = 24
 
constexpr float TEXT_META = 15
 
constexpr float TEXT_KICKER = 16
 
constexpr float TEXT_NOTE = 16.5f
 
constexpr float TEXT_BODY = 17
 
constexpr float TEXT_LEAD = 19
 
constexpr float TEXT_TITLE = 23
 

Function Documentation

◆ card()

aurore::Box * cadran::kit::card ( bool  focusable,
bool  grow 
)

A card: the surface, a 1 px line, rounded; focusable takes the focus ring (no highlight fill), and is said as a cell with the texts in it; grow shares a row with its neighbours.

◆ chip()

aurore::Box * cadran::kit::chip ( const std::string &  text,
float  height = 48 
)

◆ color()

NVGcolor cadran::kit::color ( const char *  key)

A theme colour of the boards ("cadran/teal"…), for what draws itself: looked up when drawing, it follows the theme. A view's colour is set by its key instead (View::setThemeColor), to follow a theme change.

◆ display()

aurore::Label * cadran::kit::display ( const std::string &  text,
float  size,
const char *  color_key = "cadran/text" 
)

The same in the boards' display face (Sora; the other scripts from the app's fonts): a dialog's title, a code to read out, a figure.

◆ dot_of()

const char * cadran::kit::dot_of ( NVGcolor  value_color)

The value colour a line was given, as a dot: teal (ok), amber (warn), coral (bad), or the quiet one.

◆ draw_more_below()

void cadran::kit::draw_more_below ( NVGcontext *  vg,
aurore::ScrollingFrame *  frame,
float  x,
float  y,
float  width,
float  height,
const char *  color_key,
float  corner = 0.0f 
)

Over the foot of a scrolling frame drawn at (x, y, width, height): the background (color_key) fading in over 32 px while there is more below, so a line cut by the frame's edge reads as "more", not as the end. corner: the radius of the card whose foot the frame's is (a picker's list), the fade then inside its rounded corners and its 1 px border.

◆ empty()

Empty cadran::kit::empty ( const char *  icon_name)

◆ empty_around()

aurore::Box * cadran::kit::empty_around ( aurore::Label *  label,
const char *  icon_name 
)

The same around a screen's own label (its XML's, which it fills and shows): the label becomes the card's title, in place, and ui::set_visible on it shows or hides the whole card. Returns the card.

◆ fit_button()

void cadran::kit::fit_button ( aurore::Button *  button)

A button of such a row laid out by its text at the normal size: the row breaks only where it would at that size, and with the larger text (ui/text_size) the button's text is drawn smaller again, down to its size, rather than pushing the button to a line of its own (aurore::Label::setFontScale). Again after its text changes.

◆ fit_head()

void cadran::kit::fit_head ( aurore::Box *  row)

A card's head: its title, then its state on the right; the state under the title when a language (or the larger text) leaves no room for both, each whole ("Jugendschutz", not "Jugendschut" over "z").

◆ icon()

CadranIcon * cadran::kit::icon ( const char *  name,
float  size,
const char *  color_key = "cadran/text2" 
)

An icon of the boards, size px square.

◆ key()

aurore::Box * cadran::kit::key ( const char *  letter,
float  size = 24 
)

A controller key as the boards draw it: its letter ("A", "Y", "L") in a round bubble, size px across, no margins.

◆ kicker()

aurore::Box * cadran::kit::kicker ( const char *  icon_name,
const std::string &  title 
)

A kicker with an icon before it, in a card: an icon and a title in capitals.

◆ label()

aurore::Label * cadran::kit::label ( const std::string &  text,
float  size,
const char *  color_key = "cadran/text" 
)

A label of size px in the theme colour color_key ("cadran/text2"…); several lines when it has to.

◆ long_date() [1/2]

std::string cadran::kit::long_date ( )

"jeudi 8 octobre", from the console's clock, in the app's language; the same for a "2026-10-08" (the text itself when it is not a date).

◆ long_date() [2/2]

std::string cadran::kit::long_date ( const std::string &  ymd)

◆ pill()

aurore::Box * cadran::kit::pill ( const std::string &  text,
const char *  dot_key 
)

A pill: a mark of dot_key (its first child) and its text, on a thin border.

◆ qr()

aurore::Box * cadran::kit::qr ( const std::string &  payload,
float  side,
const std::string &  title,
const std::string &  caption,
float  width = 0 
)

A QR code of payload, side px (dark on white whatever the theme, as phones read it best), its title under it and a caption smaller (either may be empty), centred; width (0: the code's own) keeps cards alike.

◆ set_kicker()

void cadran::kit::set_kicker ( aurore::Label *  label,
const std::string &  text = "" 
)

A kicker's look, the one every section title and board's line above its headline takes: TEXT_KICKER, the second ink, text in capitals (none: the label's text kept, its look only).

◆ top_card()

aurore::Box * cadran::kit::top_card ( bool  grow)

A card at the top of a screen (not a list: no rows), larger, grow shares a row.

◆ without_chevron()

std::string cadran::kit::without_chevron ( const std::string &  value)

"12 changes ›" -> "12 changes"; "›" -> "".

◆ wrap()

void cadran::kit::wrap ( aurore::View *  row)

A row whose items go on to the next line when they do not fit (the XML has no attribute for it).

Variable Documentation

◆ RADIUS_CARD

constexpr float cadran::kit::RADIUS_CARD = 20
constexpr

◆ RADIUS_ICON

constexpr float cadran::kit::RADIUS_ICON = 12
constexpr

◆ RADIUS_MODAL

constexpr float cadran::kit::RADIUS_MODAL = 24
constexpr

◆ RADIUS_ROW

constexpr float cadran::kit::RADIUS_ROW = 14
constexpr

The boards' corners, and the XML's (@style/cadran/radius/<name>, cadran::install_theme): a row on its own, a table, a picker's row (ROW); a game's icon (ICON); a card of a list, a tile (CARD); a screen's top card (TOP); a dialog's and a picker's card (MODAL). A pill is round: half its height.

◆ RADIUS_TOP

constexpr float cadran::kit::RADIUS_TOP = 22
constexpr

◆ TEXT_BODY

constexpr float cadran::kit::TEXT_BODY = 17
constexpr

◆ TEXT_KICKER

constexpr float cadran::kit::TEXT_KICKER = 16
constexpr

◆ TEXT_LEAD

constexpr float cadran::kit::TEXT_LEAD = 19
constexpr

◆ TEXT_META

constexpr float cadran::kit::TEXT_META = 15
constexpr

The boards' type scale: what is said in passing (a code, a caption, a pill), a section's kicker in capitals, a note under the lines, a line's text, a dialog's paragraph, a dialog's title (in the display face).

◆ TEXT_NOTE

constexpr float cadran::kit::TEXT_NOTE = 16.5f
constexpr

◆ TEXT_TITLE

constexpr float cadran::kit::TEXT_TITLE = 23
constexpr