How do i remove the white background from ftxui::Input elements? #960
-
I have recently been getting trouble with trying to remove this white background from the ftxui::Input element. std::string inputValue;
auto input = ftxui::Input(&inputValue, "Enter input");
auto inputWithEnterHandler = ftxui::CatchEvent(input, [&](ftxui::Event event) {
if (event == ftxui::Event::Return) {
inputValue.clear();
return true;
}
return false;
});
auto inputContainer = ftxui::Renderer(inputWithEnterHandler, [&] {
return ftxui::vbox(
{ftxui::text("Example") | ftxui::bold | ftxui::center, ftxui::filler(),
inputWithEnterHandler->Render() | ftxui::color(ftxui::Color::GrayLight) |
ftxui::border}
) |
ftxui::size(ftxui::HEIGHT, ftxui::LESS_THAN, 24) | ftxui::border |
ftxui::bgcolor(ftxui::Color::RGB(20, 20, 20));
});
auto screen = ftxui::ScreenInteractive::TerminalOutput();
screen.Loop(inputContainer); |
Beta Was this translation helpful? Give feedback.
Answered by
ArthurSonzogni
Dec 1, 2024
Replies: 1 comment 1 reply
-
Hello @a-cream Did you try to provide an See demo from examples/component/input_style.cpp |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
a-cream
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @a-cream
Did you try to provide an
InputOption::tranform
toInput
? This should give you the freedom to customize it.See demo from examples/component/input_style.cpp