Skip to content

Commit

Permalink
[Feature] Fixing color not being applied to Input (#25)
Browse files Browse the repository at this point in the history
Signed-off-by: Vedant <[email protected]>
  • Loading branch information
vrnimje authored Sep 28, 2023
1 parent 66ceb54 commit 647b36a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions include/quick-ftxui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,20 @@ struct node_printer : boost::static_visitor<> {
It != quick_ftxui_ast::strings.end()) {
ftxui::InputOption pass;
ftxui::Color input_clr = quick_ftxui_ast::resolveColour(text.color);
pass.transform = [input_clr](ftxui::InputState state) {
state.element |= ftxui::color(input_clr);
if (state.is_placeholder) {
state.element |= ftxui::dim;
}
if (state.is_placeholder && state.focused) {
state.element |= bgcolor(input_clr);
}
return state.element;
};
switch (text.opt) {
case quick_ftxui_ast::input_option::None:
data->components.push_back(ftxui::Input(&It->second, text.placeholder) |
ftxui::color(input_clr));
data->components.push_back(
ftxui::Input(&It->second, text.placeholder, pass));
break;

case quick_ftxui_ast::input_option::Password:
Expand Down

0 comments on commit 647b36a

Please sign in to comment.