#ifndef ADDITIONALWIDGET_H
#define ADDITIONALWIDGET_H


#include <QWidget>
#include <QPushButton>
#include <QPoint>

class QHBoxLayout;
class QToolButton;


class HeadButton : public QPushButton
{
    Q_OBJECT
public:
    HeadButton(const QIcon &icon, const QString &text, QWidget *parent = nullptr);
    HeadButton(const QString &text, QWidget *parent = nullptr);
    HeadButton(QWidget *parent = nullptr);

    bool hasMouse();

signals:
    void signalEnter();
    void signalLeave();

protected:
    void enterEvent(QEvent *e);
    void leaveEvent(QEvent *e);
};

class AdditionalWidget : public QWidget
{
    Q_OBJECT

public:
    explicit AdditionalWidget(QWidget *parent = nullptr);

    QRect relativePosition();

    void setNotLoginState();
    void setLoginState();

    bool headHasMouse();

signals:
    void logInfo();
    void loginInfo();
    void menuInfo();
    void enterHead();
    void leaveHead();

private:
    void initUI();
    void createConnections();

private:

    QHBoxLayout* mMainHLayout;
    QToolButton* mLogButton;
    QToolButton* mSystemButton;
    QToolButton* mLoginButton;
    HeadButton* mHeadButton;
};

#endif // ADDITIONALWIDGET_H
