granera con sarna no pica

This commit is contained in:
2026-04-08 11:07:50 +02:00
parent d70edb29e7
commit 87cc58b5dd
29 changed files with 104 additions and 244 deletions

View File

@@ -30,7 +30,7 @@ const Notifier::Style Notifier::Style::DEFAULT = {
.shape = Notifier::Shape::SQUARED,
.text_align = Notifier::TextAlign::CENTER,
.duration = 2.0F,
.sound_file = "notify.wav",
.sound_file = Defaults::Sound::Files::NOTIFY,
.play_sound = false};
const Notifier::Style Notifier::Style::CHEEVO = {
@@ -40,7 +40,7 @@ const Notifier::Style Notifier::Style::CHEEVO = {
.shape = Notifier::Shape::SQUARED,
.text_align = Notifier::TextAlign::CENTER,
.duration = 4.0F,
.sound_file = "notify.wav",
.sound_file = Defaults::Sound::Files::NOTIFY,
.play_sound = true};
// [SINGLETON] Crearemos el objeto con esta función estática
@@ -160,7 +160,7 @@ void Notifier::show(std::vector<std::string> texts, const Style& style, int icon
}
// Inicializa variables
const int TEXT_SIZE = 6;
constexpr float TEXT_SIZE = LINE_HEIGHT;
const auto PADDING_IN_H = TEXT_SIZE;
const auto PADDING_IN_V = TEXT_SIZE / 2;
const int ICON_SPACE = icon >= 0 ? ICON_SIZE + PADDING_IN_H : 0;
@@ -205,16 +205,16 @@ void Notifier::show(std::vector<std::string> texts, const Style& style, int icon
// Dibuja el fondo de la notificación
SDL_FRect rect;
if (SHAPE == Shape::ROUNDED) {
rect = {.x = 4, .y = 0, .w = WIDTH - (4 * 2), .h = HEIGHT};
rect = {.x = static_cast<float>(CORNER_RADIUS), .y = 0, .w = WIDTH - (CORNER_RADIUS * 2), .h = HEIGHT};
n.surface->fillRect(&rect, style.bg_color);
rect = {.x = 4 / 2, .y = 1, .w = WIDTH - 4, .h = HEIGHT - 2};
rect = {.x = static_cast<float>(CORNER_RADIUS / 2), .y = static_cast<float>(BORDER_INSET), .w = WIDTH - CORNER_RADIUS, .h = HEIGHT - (BORDER_INSET * 2)};
n.surface->fillRect(&rect, style.bg_color);
rect = {.x = 1, .y = 4 / 2, .w = WIDTH - 2, .h = HEIGHT - 4};
rect = {.x = static_cast<float>(BORDER_INSET), .y = static_cast<float>(CORNER_RADIUS / 2), .w = WIDTH - (BORDER_INSET * 2), .h = HEIGHT - CORNER_RADIUS};
n.surface->fillRect(&rect, style.bg_color);
rect = {.x = 0, .y = 4, .w = WIDTH, .h = HEIGHT - (4 * 2)};
rect = {.x = 0, .y = static_cast<float>(CORNER_RADIUS), .w = WIDTH, .h = HEIGHT - (CORNER_RADIUS * 2)};
n.surface->fillRect(&rect, style.bg_color);
}