mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-16 16:08:08 +08:00
Apply clang-tidy
This commit is contained in:
@@ -237,7 +237,7 @@ class TabContainer : public ContainerBase {
|
||||
|
||||
class StackedContainer : public ContainerBase {
|
||||
public:
|
||||
StackedContainer(Components children)
|
||||
explicit StackedContainer(Components children)
|
||||
: ContainerBase(std::move(children), nullptr) {}
|
||||
|
||||
private:
|
||||
@@ -252,7 +252,7 @@ class StackedContainer : public ContainerBase {
|
||||
}
|
||||
|
||||
bool Focusable() const final {
|
||||
for (auto& child : children_) {
|
||||
for (const auto& child : children_) {
|
||||
if (child->Focusable()) {
|
||||
return true;
|
||||
}
|
||||
@@ -261,13 +261,14 @@ class StackedContainer : public ContainerBase {
|
||||
}
|
||||
|
||||
Component ActiveChild() final {
|
||||
if (children_.size() == 0)
|
||||
if (children_.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
return children_[0];
|
||||
}
|
||||
|
||||
void SetActiveChild(ComponentBase* child) final {
|
||||
if (children_.size() == 0) {
|
||||
if (children_.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -91,7 +91,7 @@ Element DefaultRenderState(const WindowRenderState& state) {
|
||||
element = window(text(state.title), element);
|
||||
element |= clear_under;
|
||||
|
||||
Color color = Color::Red;
|
||||
const Color color = Color::Red;
|
||||
|
||||
element = std::make_shared<ResizeDecorator>( //
|
||||
element, //
|
||||
@@ -107,7 +107,7 @@ Element DefaultRenderState(const WindowRenderState& state) {
|
||||
|
||||
class WindowImpl : public ComponentBase, public WindowOptions {
|
||||
public:
|
||||
WindowImpl(WindowOptions option) : WindowOptions(std::move(option)) {
|
||||
explicit WindowImpl(WindowOptions option) : WindowOptions(std::move(option)) {
|
||||
if (!inner) {
|
||||
inner = Make<ComponentBase>();
|
||||
}
|
||||
@@ -118,7 +118,7 @@ class WindowImpl : public ComponentBase, public WindowOptions {
|
||||
Element Render() final {
|
||||
auto element = ComponentBase::Render();
|
||||
|
||||
bool captureable =
|
||||
const bool captureable =
|
||||
captured_mouse_ || ScreenInteractive::Active()->CaptureMouse();
|
||||
|
||||
const WindowRenderState state = {
|
||||
|
Reference in New Issue
Block a user