From 07a390ee631b72d32c187cc8e4bdd9c404297470 Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Sat, 6 Apr 2024 17:44:40 +0200 Subject: [PATCH] Apply IWYU --- examples/component/homescreen.cpp | 10 +++++----- include/ftxui/component/component.hpp | 2 +- include/ftxui/component/component_options.hpp | 1 - src/ftxui/component/button.cpp | 6 +++--- src/ftxui/component/screen_interactive.cpp | 8 ++++---- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/examples/component/homescreen.cpp b/examples/component/homescreen.cpp index 1af03a5d..d335fabf 100644 --- a/examples/component/homescreen.cpp +++ b/examples/component/homescreen.cpp @@ -494,11 +494,11 @@ int main() { "Exit", [&] { screen.Exit(); }, ButtonOption::Animated()); auto main_container = Container::Vertical({ - Container::Horizontal({ - tab_selection, - exit_button, - }), - tab_content, + Container::Horizontal({ + tab_selection, + exit_button, + }), + tab_content, }); auto main_renderer = Renderer(main_container, [&] { diff --git a/include/ftxui/component/component.hpp b/include/ftxui/component/component.hpp index 36eb605c..d9b70998 100644 --- a/include/ftxui/component/component.hpp +++ b/include/ftxui/component/component.hpp @@ -76,7 +76,7 @@ Component Radiobox(ConstStringListRef entries, Component Dropdown(ConstStringListRef entries, int* selected); Component Dropdown(DropdownOption options); - + Component Toggle(ConstStringListRef entries, int* selected); // General slider constructor: diff --git a/include/ftxui/component/component_options.hpp b/include/ftxui/component/component_options.hpp index 100a99d9..73b8a0e0 100644 --- a/include/ftxui/component/component_options.hpp +++ b/include/ftxui/component/component_options.hpp @@ -148,7 +148,6 @@ struct CheckboxOption { std::function on_change = [] {}; }; - /// @brief Used to define style for the Input component. struct InputState { Element element; diff --git a/src/ftxui/component/button.cpp b/src/ftxui/component/button.cpp index f16dcf44..04a7f84b 100644 --- a/src/ftxui/component/button.cpp +++ b/src/ftxui/component/button.cpp @@ -104,7 +104,7 @@ class ButtonBase : public ComponentBase, public ButtonOption { // TODO(arthursonzogni): Consider posting the task to the main loop, instead // of invoking it immediately. - on_click(); // May delete this. + on_click(); // May delete this. } bool OnEvent(Event event) override { @@ -113,7 +113,7 @@ class ButtonBase : public ComponentBase, public ButtonOption { } if (event == Event::Return) { - OnClick(); // May delete this. + OnClick(); // May delete this. return true; } return false; @@ -130,7 +130,7 @@ class ButtonBase : public ComponentBase, public ButtonOption { if (event.mouse().button == Mouse::Left && event.mouse().motion == Mouse::Pressed) { TakeFocus(); - OnClick(); // May delete this. + OnClick(); // May delete this. return true; } diff --git a/src/ftxui/component/screen_interactive.cpp b/src/ftxui/component/screen_interactive.cpp index dc729acb..1e1125f7 100644 --- a/src/ftxui/component/screen_interactive.cpp +++ b/src/ftxui/component/screen_interactive.cpp @@ -848,13 +848,13 @@ void ScreenInteractive::Draw(Component component) { reset_cursor_position.clear(); if (dy != 0) { - set_cursor_position += "\x1B[" + std::to_string(dy) + "A"; - reset_cursor_position += "\x1B[" + std::to_string(dy) + "B"; + set_cursor_position += "\x1B[" + std::to_string(dy) + "A"; + reset_cursor_position += "\x1B[" + std::to_string(dy) + "B"; } if (dx != 0) { - set_cursor_position += "\x1B[" + std::to_string(dx) + "D"; - reset_cursor_position += "\x1B[" + std::to_string(dx) + "C"; + set_cursor_position += "\x1B[" + std::to_string(dx) + "D"; + reset_cursor_position += "\x1B[" + std::to_string(dx) + "C"; } if (cursor_.shape == Cursor::Hidden) {