mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-19 18:18:09 +08:00
Run IWYU. (#208)
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
#include <stddef.h> // for size_t
|
||||
#include <algorithm> // for max, min
|
||||
#include <memory> // for __shared_ptr_access, shared_ptr, make_shared, allocator, __shared_ptr_access<>::element_type, allocator_traits<>::value_type
|
||||
#include <memory> // for make_shared, __shared_ptr_access, allocator, shared_ptr, allocator_traits<>::value_type
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector, __alloc_traits<>::value_type
|
||||
|
||||
#include "ftxui/component/component.hpp" // for Component, Components, Horizontal, Vertical, Tab
|
||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||
#include "ftxui/component/component.hpp" // for Horizontal, Vertical, Tab
|
||||
#include "ftxui/component/component_base.hpp" // for Components, Component, ComponentBase
|
||||
#include "ftxui/component/event.hpp" // for Event, Event::Tab, Event::TabReverse, Event::ArrowDown, Event::ArrowLeft, Event::ArrowRight, Event::ArrowUp
|
||||
#include "ftxui/dom/elements.hpp" // for text, Elements, Element, hbox, vbox
|
||||
#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::WheelDown, Mouse::WheelUp
|
||||
#include "ftxui/dom/elements.hpp" // for text, Elements, operator|, reflect, Element, hbox, vbox
|
||||
#include "ftxui/screen/box.hpp" // for Box
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
|
@@ -185,10 +185,10 @@ Component MenuEntry(ConstStringRef label, Ref<MenuEntryOption> option) {
|
||||
private:
|
||||
Element Render() override {
|
||||
bool focused = Focused();
|
||||
auto style = hovered_ ? (focused ? option_->style_selected_focused
|
||||
: option_->style_selected)
|
||||
: (focused ? option_->style_focused
|
||||
: option_->style_normal);
|
||||
auto style =
|
||||
hovered_ ? (focused ? option_->style_selected_focused
|
||||
: option_->style_selected)
|
||||
: (focused ? option_->style_focused : option_->style_normal);
|
||||
auto focus_management = focused ? select : nothing;
|
||||
auto label = focused ? "> " + (*label_) //
|
||||
: " " + (*label_);
|
||||
|
@@ -149,7 +149,6 @@ Element border(Element child) {
|
||||
return std::make_shared<Border>(unpack(std::move(child)), ROUNDED);
|
||||
}
|
||||
|
||||
|
||||
/// @brief Same as border but with a constant Pixel around the element.
|
||||
/// @ingroup dom
|
||||
/// @see border
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#include "ftxui/dom/box_helper.hpp"
|
||||
|
||||
#include <algorithm> // for max
|
||||
|
||||
namespace ftxui {
|
||||
namespace box_helper {
|
||||
|
||||
@@ -83,3 +85,7 @@ void Compute(std::vector<Element>* elements, int target_size) {
|
||||
|
||||
} // namespace box_helper
|
||||
} // namespace ftxui
|
||||
|
||||
// Copyright 2021 Arthur Sonzogni. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be found in
|
||||
// the LICENSE file.
|
||||
|
@@ -22,3 +22,7 @@ void Compute(std::vector<Element>* elements, int target_size);
|
||||
} // namespace ftxui
|
||||
|
||||
#endif /* end of include guard: FTXUI_DOM_BOX_HELPER_HPP */
|
||||
|
||||
// Copyright 2021 Arthur Sonzogni. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be found in
|
||||
// the LICENSE file.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include <cmath>
|
||||
#include <memory> // for allocator, make_shared
|
||||
#include <string> // for string
|
||||
#include <algorithm> // for max, min
|
||||
#include <memory> // for allocator, make_shared
|
||||
#include <string> // for string
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for Element, gauge
|
||||
#include "ftxui/dom/node.hpp" // for Node
|
||||
|
@@ -1,16 +1,17 @@
|
||||
#include <iostream>
|
||||
#include <algorithm> // for max
|
||||
#include <memory> // for __shared_ptr_access, shared_ptr, make_shared
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector
|
||||
#include <stddef.h> // for size_t
|
||||
#include <algorithm> // for max, min
|
||||
#include <memory> // for __shared_ptr_access, shared_ptr, make_shared, allocator_traits<>::value_type
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector, __alloc_traits<>::value_type
|
||||
|
||||
#include "ftxui/dom/box_helper.hpp" // for Requirement
|
||||
#include "ftxui/dom/elements.hpp" // for Element, Elements, hbox
|
||||
#include "ftxui/dom/box_helper.hpp" // for Element, Compute
|
||||
#include "ftxui/dom/elements.hpp" // for Elements, filler, Element, gridbox
|
||||
#include "ftxui/dom/node.hpp" // for Node
|
||||
#include "ftxui/dom/requirement.hpp" // for Requirement
|
||||
#include "ftxui/screen/box.hpp" // for Box
|
||||
|
||||
namespace ftxui {
|
||||
class Screen;
|
||||
|
||||
class GridBox : public Node {
|
||||
public:
|
||||
@@ -19,9 +20,9 @@ class GridBox : public Node {
|
||||
for (const auto& line : lines_)
|
||||
x_size = std::max(x_size, (int)line.size());
|
||||
for (auto& line : lines_) {
|
||||
while (line.size() < (size_t)y_size) {
|
||||
line.push_back(filler());
|
||||
}
|
||||
while (line.size() < (size_t)y_size) {
|
||||
line.push_back(filler());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +34,8 @@ class GridBox : public Node {
|
||||
requirement_.flex_shrink_x = 0;
|
||||
requirement_.flex_shrink_y = 0;
|
||||
|
||||
for(auto& line : lines_) {
|
||||
for(auto& cell : line) {
|
||||
for (auto& line : lines_) {
|
||||
for (auto& cell : line) {
|
||||
cell->ComputeRequirement();
|
||||
|
||||
// Determine focus based on the focused child.
|
||||
|
@@ -1,11 +1,12 @@
|
||||
#include <gtest/gtest-message.h> // for Message
|
||||
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
|
||||
#include <algorithm> // for remove
|
||||
#include <string> // for allocator, basic_string, string
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for text, operator|, Element, flex_grow, flex_shrink, gridbox
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/box.hpp" // for ftxui
|
||||
#include "ftxui/dom/elements.hpp" // for text, operator|, Element, flex, flex_grow, Elements, flex_shrink, vtext, gridbox, vbox, border
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/box.hpp" // for ftxui
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
|
||||
|
||||
|
@@ -1,11 +1,12 @@
|
||||
#include <stddef.h> // for size_t
|
||||
#include <algorithm> // for max
|
||||
#include <memory> // for __shared_ptr_access, shared_ptr, make_shared
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector
|
||||
#include <memory> // for __shared_ptr_access, shared_ptr, make_shared, allocator_traits<>::value_type
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector, __alloc_traits<>::value_type
|
||||
|
||||
#include "ftxui/dom/box_helper.hpp" // for Box
|
||||
#include "ftxui/dom/box_helper.hpp" // for Element, Compute
|
||||
#include "ftxui/dom/elements.hpp" // for Element, Elements, hbox
|
||||
#include "ftxui/dom/node.hpp" // for Node
|
||||
#include "ftxui/dom/node.hpp" // for Node, Elements
|
||||
#include "ftxui/dom/requirement.hpp" // for Requirement
|
||||
#include "ftxui/screen/box.hpp" // for Box
|
||||
|
||||
|
@@ -1,11 +1,12 @@
|
||||
#include <memory> // for make_shared, __shared_ptr_access
|
||||
#include <utility> // for move
|
||||
#include <vector> // for __alloc_traits<>::value_type, vector
|
||||
#include <vector> // for __alloc_traits<>::value_type
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for Element, unpack, Decorator, reflect
|
||||
#include "ftxui/dom/node.hpp" // for Node
|
||||
#include "ftxui/dom/node.hpp" // for Node, Elements
|
||||
#include "ftxui/dom/requirement.hpp" // for Requirement
|
||||
#include "ftxui/screen/box.hpp" // for Box
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
|
@@ -1,11 +1,12 @@
|
||||
#include <stddef.h> // for size_t
|
||||
#include <algorithm> // for max
|
||||
#include <memory> // for __shared_ptr_access, shared_ptr, make_shared
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector
|
||||
#include <memory> // for __shared_ptr_access, shared_ptr, make_shared, allocator_traits<>::value_type
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector, __alloc_traits<>::value_type
|
||||
|
||||
#include "ftxui/dom/box_helper.hpp" // for Box
|
||||
#include "ftxui/dom/box_helper.hpp" // for Element, Compute
|
||||
#include "ftxui/dom/elements.hpp" // for Element, Elements, vbox
|
||||
#include "ftxui/dom/node.hpp" // for Node
|
||||
#include "ftxui/dom/node.hpp" // for Node, Elements
|
||||
#include "ftxui/dom/requirement.hpp" // for Requirement
|
||||
#include "ftxui/screen/box.hpp" // for Box
|
||||
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#include <stdint.h> // for uint16_t
|
||||
#include <iostream> // for operator<<, stringstream, basic_ostream, flush, cout, ostream
|
||||
#include <map>
|
||||
#include <memory> // for allocator
|
||||
#include <map> // for _Rb_tree_const_iterator, map, operator!=, operator==
|
||||
#include <memory> // for allocator, allocator_traits<>::value_type
|
||||
#include <sstream> // IWYU pragma: keep
|
||||
#include <utility> // for pair
|
||||
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include "ftxui/screen/string.hpp" // for string_width
|
||||
|
Reference in New Issue
Block a user