Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
ui::Choice Struct Reference

#include <aurore/cadran/ui/ui.hpp>

Public Types

enum class  Tone { PLAIN , ON , WARN , DANGER }
 

Public Member Functions

 Choice (std::string text, std::function< void()> action, const char *icon_name=nullptr, std::string detail_text="", std::string group_name="", Tone line_tone=Tone::PLAIN)
 
Choice & switched (bool on)
 

Public Attributes

std::string label
 
std::function< void()> run
 
const char * icon
 
std::string detail
 
std::string group
 
Tone tone
 
int toggle = -1
 switched(): 1 on, 0 off
 

Detailed Description

A 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 now at its end (detail), its group (a section starts where it changes, its name the kicker above it) and its tone (ON: the detail in teal, WARN: amber, DANGER: a removal, in coral); switched(): a switch at its end, on or off, instead of the detail. A line without run only closes the sheet. subtitle, under the title: what it is about now; image, an NVG image before the title (someone else's, kept). The first line is selected; none, no sheet.

Member Enumeration Documentation

◆ Tone

enum class ui::Choice::Tone
strong
Enumerator
PLAIN 
ON 
WARN 
DANGER 

Constructor & Destructor Documentation

◆ Choice()

ui::Choice::Choice ( std::string  text,
std::function< void()>  action,
const char *  icon_name = nullptr,
std::string  detail_text = "",
std::string  group_name = "",
Tone  line_tone = Tone::PLAIN 
)
inline

Member Function Documentation

◆ switched()

Choice & ui::Choice::switched ( bool  on)
inline

Member Data Documentation

◆ detail

std::string ui::Choice::detail

◆ group

std::string ui::Choice::group

◆ icon

const char* ui::Choice::icon

◆ label

std::string ui::Choice::label

◆ run

std::function<void()> ui::Choice::run

◆ toggle

int ui::Choice::toggle = -1

switched(): 1 on, 0 off

◆ tone

Tone ui::Choice::tone

The documentation for this struct was generated from the following file: