- canvi en el ordre dels overlays

- les notificacions ja segueixen al resto de elements (no tenen una posició fixa)
This commit is contained in:
2026-04-12 15:52:37 +02:00
parent db3cb06c7a
commit 6644eedfcd
4 changed files with 35 additions and 12 deletions

View File

@@ -277,9 +277,32 @@ void Notifier::clearNotifications() {
clearFinishedNotifications();
}
// Ajusta el offset vertical base
void Notifier::addYOffset(int px) { y_offset_ += px; }
void Notifier::removeYOffset(int px) { y_offset_ -= px; }
// Ajusta el offset vertical base y desplaza las notificaciones existentes
void Notifier::addYOffset(int px) {
y_offset_ += px;
for (auto& n : notifications_) {
n.y += px;
n.rect.y += static_cast<float>(px);
}
}
void Notifier::removeYOffset(int px) {
y_offset_ -= px;
for (auto& n : notifications_) {
n.y -= px;
n.rect.y -= static_cast<float>(px);
}
}
// Altura visible ocupada por las notificaciones activas (relativa al offset base)
auto Notifier::getVisibleHeight() const -> int {
int bottom = 0;
for (const auto& n : notifications_) {
if (n.state == Status::FINISHED) { continue; }
int n_bottom = static_cast<int>(n.rect.y + n.rect.h) - y_offset_;
if (n_bottom > bottom) { bottom = n_bottom; }
}
return bottom;
}
// Obtiene los códigos de las notificaciones
auto Notifier::getCodes() -> std::vector<std::string> {

View File

@@ -57,8 +57,9 @@ class Notifier {
const std::string& code = std::string()); // Mostrar notificación
// Consultas
auto isActive() -> bool; // Indica si hay notificaciones activas
auto getCodes() -> std::vector<std::string>; // Obtiene códigos de notificaciones
auto isActive() -> bool; // Indica si hay notificaciones activas
auto getCodes() -> std::vector<std::string>; // Obtiene códigos de notificaciones
[[nodiscard]] auto getVisibleHeight() const -> int; // Altura ocupada por notificaciones activas
// Offset vertical (para evitar solapamiento con Console y renderInfo)
void addYOffset(int px); // Suma píxeles al offset base