Apply clang-tidy

This commit is contained in:
ArthurSonzogni
2023-08-08 01:57:43 +02:00
parent e2a205ed0d
commit 461d557674
5 changed files with 15 additions and 11 deletions

View File

@@ -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;
}

View File

@@ -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 = {