/***************************************************************************
 **
 **  Copyright (C) 2018-2023 wangjianjun <wangjianjun1018@qq.com>
 **  Contact: https://blog.csdn.net/wocanimei007?type=blog
 **
 **
****************************************************************************/
#ifndef FANCYDIALOG_H
#define FANCYDIALOG_H

#include <QDialog>
#include "frameless_global.h"
#include "fancybar.h"



class FancyDialogPrivate;
class FRAMELESS_SHARED_EXPORT FancyDialog : public QDialog
{
    Q_OBJECT
public:
    explicit FancyDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
    ~FancyDialog();

    void setCentralWidget(QWidget *w);
    void setWidgetResizable(bool resizable);
    void setTitleBarHeight(int height);
    void setTitleBarColor(const QColor& color);
    void addAdditionalControl(QAction *action);

    void setFixedSize(const QSize &s);
    void setFixedSize(int w, int h);
    void setFixedWidth(int w);
    void setFixedHeight(int h);

    void setWindowFlags(Qt::WindowFlags type);

    void setBackgroundImage(const QString& path);

    FancyBar* fancyBar();
protected:
    virtual void paintEvent(QPaintEvent *event);

private:
    FancyDialogPrivate *d;
    QString m_sBackgroundImagePath;
};



#endif // FANCYDIALOG_H
