#ifndef QUAD_BTNS_TITLE_BAR_H
#define QUAD_BTNS_TITLE_BAR_H

#include <QObject>
#include <QBoxLayout>
#include "menumodule.h"

enum class QuadBtnsShowMode:int
{
    ALL = 0,
    NO_MENU_BTN,
    NO_MAX_BTN,
    ONLY_CLOSE_BTN,
};

class QuadBtnsTitleBar : public QWidget
{
    Q_OBJECT
public:
    QuadBtnsTitleBar(QWidget *mainWin,
                     bool hasMenuBtn = true,
                     bool hasMinBtn = true,
                     bool hasMaxBtn = true,
                     bool hasCloseBtn = true);
    void setShowBtnsMode(QuadBtnsShowMode mode,QWidget *mainWin);
    void setQSSFontSize(QFont curFont);
    QPushButton *getCloseButton();
private:
    QWidget *m_parentWin;
    QHBoxLayout *m_HwholeLayout;
    MenuModule  *m_menuBtn;
    QPushButton *m_minBtn;
    QPushButton *m_maxBtn;
    QPushButton *m_closeBtn;
    void initConnect(QWidget *mainWin,
                     bool hasMenuBtn,
                     bool hasMinBtn,
                     bool hasMaxBtn,
                     bool hasCloseBtn);
    void setCloseHide();
};

#endif // QUAD_BTNS_TITLE_BAR_H
