86 if (!state.focused && !state.active) {
102 option.underline.enabled =
true;
113 Element e =
text((state.active ?
"> " :
" ") + state.label);
120 if (!state.focused && !state.active) {
134 option.entries_option.transform = [](
const EntryState& state) {
142 if (!state.focused && !state.active) {
147 option.underline.enabled =
true;
157 option.elements_infix = [] {
return text(
"│") |
automerge; };
167 const std::string t = s.focused ?
"[" + s.label +
"]"
168 :
" " + s.label +
" ";
244 Color background_active,
245 Color foreground_active) {
265#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
268 auto prefix =
text(s.state ?
"[X] " :
"[ ] ");
270 auto prefix =
text(s.state ?
"▣ " :
"☐ ");
272 auto t =
text(s.label);
279 return hbox({prefix, t});
290#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
293 auto prefix =
text(s.state ?
"(*) " :
"( ) ");
295 auto prefix =
text(s.state ?
"◉ " :
"○ ");
297 auto t =
text(s.label);
304 return hbox({prefix, t});
317 if (state.is_placeholder) {
318 state.element |=
dim;
323 }
else if (state.hovered) {
327 return state.element;
341 if (state.is_placeholder) {
342 state.element |=
dim;
353 return state.element;
A class representing terminal colors.
static Color Interpolate(float t, const Color &a, const Color &b)
std::function< float(float)> Function
std::chrono::duration< float > Duration
Decorator bgcolor(Color)
Decorate using a background color.
std::shared_ptr< Node > Element
Element bold(Element)
Use a bold font, for elements with more emphasis.
Element hbox(Elements)
A container displaying elements horizontally one by one.
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.
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)
A color option that can be animated. @params _inactive The color when the component is inactive....
AnimatedColorOption foreground
AnimatedColorOption background
Option for the Checkbox component.
static CheckboxOption Simple()
Option for standard Checkbox.
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
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)
Set how the underline should animate.
animation::Duration leader_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