0
0
mirror of https://github.com/ArthurSonzogni/ftxui.git synced 2026-01-18 17:21:33 +01:00

Make Input style colorscheme agnostic.

This wasn't working well with pytxis.

Fixed:https://github.com/ArthurSonzogni/FTXUI/issues/1170
This commit is contained in:
ArthurSonzogni
2025-12-29 11:31:35 +01:00
parent 29ff502e43
commit 3330de961c
2 changed files with 6 additions and 9 deletions

View File

@@ -46,6 +46,8 @@ Next
- Fix Windows UTF-16 key input handling. Emoji and other code points outside the
Basic Multilingual Plane (BMP) are now correctly processed. Thanks @739C1AE2
in #1160 for fixing the issue.
- Fix Input style is now colorschem agnostic. Thanks @Smail in #1170 for reporting
and fixing the issue.
### Dom
- Fix integer overflow in `ComputeShrinkHard`. Thanks @its-pablo in #1137 for

View File

@@ -292,8 +292,6 @@ RadioboxOption RadioboxOption::Simple() {
InputOption InputOption::Default() {
InputOption option;
option.transform = [](InputState state) {
state.element |= color(Color::White);
if (state.is_placeholder) {
state.element |= dim;
}
@@ -301,7 +299,7 @@ InputOption InputOption::Default() {
if (state.focused) {
state.element |= inverted;
} else if (state.hovered) {
state.element |= bgcolor(Color::GrayDark);
state.element |= underlined;
}
return state.element;
@@ -315,18 +313,15 @@ InputOption InputOption::Spacious() {
InputOption option;
option.transform = [](InputState state) {
state.element |= borderEmpty;
state.element |= color(Color::White);
if (state.is_placeholder) {
state.element |= dim;
}
if (state.focused) {
state.element |= bgcolor(Color::Black);
}
if (state.hovered) {
state.element |= bgcolor(Color::GrayDark);
state.element |= inverted;
} else if (state.hovered) {
state.element |= bold;
}
return state.element;