claude: arreglos d'estil

This commit is contained in:
2025-08-16 19:48:32 +02:00
parent 1ced698093
commit ada5025c65
62 changed files with 903 additions and 1102 deletions

View File

@@ -16,13 +16,13 @@ class Texture;
// --- Clase Notifier: gestiona las notificaciones en pantalla (singleton) ---
class Notifier {
public:
// Posiciones de las notificaciones
// --- Enums ---
enum class Position {
TOP,
BOTTOM,
LEFT,
MIDDLE,
RIGHT,
TOP, // Parte superior
BOTTOM, // Parte inferior
LEFT, // Lado izquierdo
MIDDLE, // Centro
RIGHT, // Lado derecho
};
// --- Métodos de singleton ---
@@ -41,31 +41,31 @@ class Notifier {
auto checkCode(const std::string &code) -> bool { return stringInVector(getCodes(), code); } // Comprueba si hay alguna notificación con un código concreto
private:
// --- Tipos internos ---
// --- Enums privados ---
enum class State {
RISING,
STAY,
VANISHING,
FINISHED,
RISING, // Apareciendo
STAY, // Visible
VANISHING, // Desapareciendo
FINISHED, // Terminada
};
enum class Shape {
ROUNDED,
SQUARED,
ROUNDED, // Forma redondeada
SQUARED, // Forma cuadrada
};
// --- Estructura Notification ---
// --- Estructuras privadas ---
struct Notification {
std::shared_ptr<Texture> texture; // Textura de la notificación
std::shared_ptr<Sprite> sprite; // Sprite asociado
std::vector<std::string> texts; // Textos a mostrar
int counter{0}; // Contador de tiempo
SDL_FRect rect; // Rectángulo de la notificación
std::string code; // Código identificador de la notificación
State state{State::RISING}; // Estado de la notificación
Shape shape{Shape::SQUARED}; // Forma de la notificación
SDL_FRect rect; // Rectángulo de la notificación
int counter{0}; // Contador de tiempo
int y{0}; // Posición vertical
int travel_dist{0}; // Distancia a recorrer
std::string code; // Código identificador de la notificación
// Constructor
explicit Notification()
@@ -78,9 +78,9 @@ class Notifier {
std::shared_ptr<Text> text_; // Objeto para dibujar texto
// --- Variables de estado ---
std::vector<Notification> notifications_; // Lista de notificaciones activas
Color bg_color_; // Color de fondo de las notificaciones
int wait_time_; // Tiempo que se ve la notificación
std::vector<Notification> notifications_; // Lista de notificaciones activas
bool stack_; // Indica si las notificaciones se apilan
bool has_icons_; // Indica si el notificador tiene textura para iconos
@@ -97,10 +97,10 @@ class Notifier {
static void moveNotificationVertically(Notification &notification, int direction); // Mueve verticalmente una notificación en una dirección dada (útil para animación en apilamiento)
void transitionToStayState(int index); // Cambia el estado de una notificación de RISING a STAY cuando ha alcanzado su posición final
// --- Constructor y destructor ---
// --- Constructores y destructor privados (singleton) ---
Notifier(std::string icon_file, std::shared_ptr<Text> text); // Constructor privado
~Notifier() = default; // Destructor privado
// --- Singleton ---
static Notifier *instance;
// --- Instancia singleton ---
static Notifier *instance; // Instancia única de Notifier
};