#ifndef CLICKABLELABEL_H
#define CLICKABLELABEL_H

#include <QObject>
#include <QWidget>
#include <QLabel>
#include <QMouseEvent>

class MenuEntry : public QLabel {
    Q_OBJECT

public:
    explicit MenuEntry(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
    ~MenuEntry();
    static MenuEntry *getActiveLabel();
    static void setActiveLabel(MenuEntry *label);
    static MenuEntry *getHoverLabel();
    static void setHoverLabel(MenuEntry *label);

signals:
    void clicked();
    void active_label_changed();
    void hover_label_changed();

protected:
    void mousePressEvent(QMouseEvent* event);
    void mouseMoveEvent(QMouseEvent *event) override;

private slots:
    void on_clicked();

private:
    static MenuEntry *active_label;
    static MenuEntry *hover_label;
    const QString default_stylesheet = "color:rgb(255, 255, 255);";
    const QString active_stylesheet = "color:rgb(200, 200, 200);";
};

#endif // CLICKABLELABEL_H
