80 if (!state.focused && !state.active) {
95 option.underline.enabled =
true;
105 Element e =
text((state.active ?
"> " :
" ") + state.label);
112 if (!state.focused && !state.active) {
125 option.entries_option.transform = [](
const EntryState& state) {
133 if (!state.focused && !state.active) {
138 option.underline.enabled =
true;
147 option.elements_infix = [] {
return text(
"│") |
automerge; };
156 const std::string t = s.focused ?
"[" + s.label +
"]"
157 :
" " + s.label +
" ";
227 Color background_active,
228 Color foreground_active) {
247#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
250 auto prefix =
text(s.state ?
"[X] " :
"[ ] ");
252 auto prefix =
text(s.state ?
"▣ " :
"☐ ");
254 auto t =
text(s.label);
261 return hbox({prefix, t});
271#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
274 auto prefix =
text(s.state ?
"(*) " :
"( ) ");
276 auto prefix =
text(s.state ?
"◉ " :
"○ ");
278 auto t =
text(s.label);
285 return hbox({prefix, t});
297 if (state.is_placeholder) {
298 state.element |=
dim;
303 }
else if (state.hovered) {
307 return state.element;
320 if (state.is_placeholder) {
321 state.element |=
dim;
332 return state.element;
static ButtonOption Animated()
Create a ButtonOption, using animated colors.
static MenuOption Toggle()
Standard options for a horizontal menu with some separator. This can be useful to implement a tab bar...
animation::Duration follower_duration
animation::easing::Function leader_function
MenuEntryOption entries_option
static InputOption Default()
Create the default input style:
animation::easing::Function function
static ButtonOption Border()
Create a ButtonOption. The button is shown using a border, inverted when focused. This is the current...
void SetAnimationFunction(animation::easing::Function f)
Set how the underline should animate.
static InputOption Spacious()
A white on black style with high margins:
static CheckboxOption Simple()
Option for standard Checkbox.
static ButtonOption Simple()
Create a ButtonOption, inverted when focused.
std::function< Element(const EntryState &state)> transform
static MenuOption Horizontal()
Standard options for a horizontal menu. This can be useful to implement a tab bar.
static MenuOption VerticalAnimated()
Standard options for an animated vertical menu. This can be useful to implement a list of selectable ...
animation::Duration leader_duration
static MenuOption Vertical()
Standard options for a vertical menu. This can be useful to implement a list of selectable items.
static ButtonOption Ascii()
Create a ButtonOption, highlighted using [] characters.
animation::Duration duration
void SetAnimation(animation::Duration d, animation::easing::Function f)
Set how the underline should animate.
void SetAnimationDuration(animation::Duration d)
Set how the underline should animate.
animation::easing::Function follower_function
std::function< Element(InputState)> transform
std::function< Element()> elements_infix
AnimatedColorsOption animated_colors
void Set(Color inactive, Color active, animation::Duration duration=std::chrono::milliseconds(250), animation::easing::Function function=animation::easing::QuadraticInOut)
A color option that can be animated. @params _inactive The color when the component is inactive....
static MenuOption HorizontalAnimated()
Standard options for an animated horizontal menu. This can be useful to implement a tab bar.
static RadioboxOption Simple()
Option for standard Radiobox.
std::function< Element(const EntryState &)> transform
Option for the Checkbox component.
Option for the Radiobox component.
Decorator bgcolor(Color)
Decorate using a background color.
Element bold(Element)
Use a bold font, for elements with more emphasis.
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 border(Element)
Draw a border around the element.
Element borderEmpty(Element)
Draw an empty border around the element.
Decorator color(Color)
Decorate using a foreground color.
static Color Interpolate(float t, const Color &a, const Color &b)
Color is a class that represents a color in the terminal user interface.
std::function< float(float)> Function
std::chrono::duration< float > Duration
The FTXUI ftxui:: namespace.
std::shared_ptr< Node > Element
Element hbox(Elements)
A container displaying elements horizontally one by one.
AnimatedColorOption foreground
AnimatedColorOption background
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...