mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 02:34:21 +08:00
Implement ButtonOption::Border() (#472)
It was missing. See: https://github.com/ArthurSonzogni/FTXUI/issues/471
This commit is contained in:
parent
b3ba747d82
commit
1661a5e83d
@ -22,6 +22,7 @@ current (development)
|
|||||||
- various values (value, min, max, increment).
|
- various values (value, min, max, increment).
|
||||||
- Improvement: The `Menu` keeps the focus when an entry is selected with the
|
- Improvement: The `Menu` keeps the focus when an entry is selected with the
|
||||||
mouse.
|
mouse.
|
||||||
|
- Bug: Add implementation of `ButtonOption::Border()`. It was missing.
|
||||||
|
|
||||||
### Screen
|
### Screen
|
||||||
- Feature: add `Box::Union(a,b) -> Box`
|
- Feature: add `Box::Union(a,b) -> Box`
|
||||||
|
@ -144,6 +144,23 @@ ButtonOption ButtonOption::Simple() {
|
|||||||
return option;
|
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.
|
/// @brief Create a ButtonOption, using animated colors.
|
||||||
// static
|
// static
|
||||||
ButtonOption ButtonOption::Animated() {
|
ButtonOption ButtonOption::Animated() {
|
||||||
|
Loading…
Reference in New Issue
Block a user