mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-17 00:18:11 +08:00
Implement ButtonOption::Border() (#472)
It was missing. See: https://github.com/ArthurSonzogni/FTXUI/issues/471
This commit is contained in:
@@ -144,6 +144,23 @@ ButtonOption ButtonOption::Simple() {
|
||||
return option;
|
||||
}
|
||||
|
||||
/// @brief Create a ButtonOption. The button is shown using a border, inverted
|
||||
/// when focused. This is the current default.
|
||||
ButtonOption ButtonOption::Border() {
|
||||
ButtonOption option;
|
||||
option.transform = [](const EntryState& s) {
|
||||
auto element = text(s.label) | border;
|
||||
if (s.active) {
|
||||
element |= bold;
|
||||
}
|
||||
if (s.focused) {
|
||||
element |= inverted;
|
||||
}
|
||||
return element;
|
||||
};
|
||||
return option;
|
||||
}
|
||||
|
||||
/// @brief Create a ButtonOption, using animated colors.
|
||||
// static
|
||||
ButtonOption ButtonOption::Animated() {
|
||||
|
Reference in New Issue
Block a user