clang-tidy

This commit is contained in:
2025-08-17 10:20:41 +02:00
parent b359a73d50
commit 8ddc5d94f1
73 changed files with 867 additions and 833 deletions

View File

@@ -164,8 +164,7 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string&
}
// Elimina las cadenas vacías
texts.erase(std::remove_if(texts.begin(), texts.end(), [](const std::string& s) { return s.empty(); }),
texts.end());
texts.erase(std::ranges::remove_if(texts, [](const std::string& s) { return s.empty(); }).begin(), texts.end());
// Encuentra la cadena más larga
std::string longest;
@@ -224,7 +223,7 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string&
n.texts = texts;
n.shape = SHAPE;
const float POS_Y = offset + (param.notification.pos_v == Position::TOP ? -TRAVEL_DIST : TRAVEL_DIST);
n.rect = {desp_h, POS_Y, WIDTH, HEIGHT};
n.rect = {.x = desp_h, .y = POS_Y, .w = WIDTH, .h = HEIGHT};
// Crea la textura
n.texture = std::make_shared<Texture>(renderer_);
@@ -238,16 +237,16 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string&
SDL_SetRenderDrawColor(renderer_, bg_color_.r, bg_color_.g, bg_color_.b, 255);
SDL_FRect rect;
if (SHAPE == Shape::ROUNDED) {
rect = {4, 0, WIDTH - (4 * 2), HEIGHT};
rect = {.x = 4, .y = 0, .w = WIDTH - (4 * 2), .h = HEIGHT};
SDL_RenderFillRect(renderer_, &rect);
rect = {4 / 2, 1, WIDTH - 4, HEIGHT - 2};
rect = {.x = 4 / 2, .y = 1, .w = WIDTH - 4, .h = HEIGHT - 2};
SDL_RenderFillRect(renderer_, &rect);
rect = {1, 4 / 2, WIDTH - 2, HEIGHT - 4};
rect = {.x = 1, .y = 4 / 2, .w = WIDTH - 2, .h = HEIGHT - 4};
SDL_RenderFillRect(renderer_, &rect);
rect = {0, 4, WIDTH, HEIGHT - (4 * 2)};
rect = {.x = 0, .y = 4, .w = WIDTH, .h = HEIGHT - (4 * 2)};
SDL_RenderFillRect(renderer_, &rect);
}
@@ -271,7 +270,7 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string&
const Color COLOR{255, 255, 255};
int iterator = 0;
for (const auto& text : texts) {
text_->writeColored(PADDING_IN_H + ICON_SPACE, PADDING_IN_V + iterator * (text_->getCharacterSize() + 1), text, COLOR);
text_->writeColored(PADDING_IN_H + ICON_SPACE, PADDING_IN_V + (iterator * (text_->getCharacterSize() + 1)), text, COLOR);
++iterator;
}