57 if (!state.focused && !state.active) {
70 option.underline.enabled =
true;
78 Element e =
text((state.active ?
"> " :
" ") + state.label);
85 if (!state.focused && !state.active) {
96 option.entries.transform = [](
const EntryState& state) {
104 if (!state.focused && !state.active) {
109 option.underline.enabled =
true;
116 option.elements_infix = [] {
return text(
"│") |
automerge; };
125 std::string label = s.focused ?
"[" + s.label +
"]"
126 :
" " + s.label +
" ";
173 Color background_active,
174 Color foreground_active) {
193#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
196 auto prefix =
text(s.state ?
"[X] " :
"[ ] ");
198 auto prefix =
text(s.state ?
"▣ " :
"☐ ");
200 auto t =
text(s.label);
207 return hbox({prefix, t});
217#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
220 auto prefix =
text(s.state ?
"(*) " :
"( ) ");
222 auto prefix =
text(s.state ?
"◉ " :
"○ ");
224 auto t =
text(s.label);
231 return hbox({prefix, t});
A class representing terminal colors.
static Color Interpolate(float t, const Color &a, const Color &b)
std::function< float(float)> Function
std::chrono::duration< double > Duration
AnimatedColorOption foreground
std::shared_ptr< Node > Element
Element bold(Element)
Use a bold font, for elements with more emphasis.
AnimatedColorOption background
Element hbox(Elements)
A container displaying elements horizontally one by one.
std::function< Element(const EntryState &state)> transform
Element inverted(Element)
Add a filter that will invert the foreground and the background colors.
Element text(std::wstring text)
Display a piece of unicode text.
Element borderLight(Element)
Draw a light border around the element.
Element dim(Element)
Use a light font, for elements with less emphasis.
Element automerge(Element child)
Enable character to be automatically merged with others nearby.
Element borderEmpty(Element)
Draw an empty border around the element.
Decorator color(Color)
Decorate using a foreground color.
arguments for |ButtonOption::transform|, |CheckboxOption::transform|, |Radiobox::transform|,...
animation::easing::Function function
animation::Duration duration
void Set(Color inactive, Color active, animation::Duration duration=std::chrono::milliseconds(250), animation::easing::Function function=animation::easing::QuadraticInOut)
Option for the Checkbox component.
static CheckboxOption Simple()
Option for standard Checkbox.
Option for the Radiobox component.
static RadioboxOption Simple()
Option for standard Radiobox.
animation::Duration follower_duration
animation::easing::Function leader_function
void SetAnimationFunction(animation::easing::Function f)
animation::Duration leader_duration
void SetAnimation(animation::Duration d, animation::easing::Function f)
void SetAnimationDuration(animation::Duration d)
animation::easing::Function follower_function