#ifndef BASEWIDGET_H
#define BASEWIDGET_H

#include <QWidget>
#include <QGSettings>
#include <QVBoxLayout>
#include <QScrollArea>

class baseWidget : public QWidget
{
    Q_OBJECT
public:
    explicit baseWidget(QWidget *parent = nullptr);
    virtual ~baseWidget();
    void initOpacityGSettings();
    void showBaseWindow();
    void initUi();
    void setMaxHeight(int height);
    void updateSize();

    QVBoxLayout * mainWindowVboxLayout;
    QTimer *m_hideTimer;

protected:
    void paintEvent(QPaintEvent * event);
    bool eventFilter(QObject *watched, QEvent *event);

private:
    QGSettings *m_gsTransOpacity = nullptr;
    qreal m_curTransOpacity = 1;

    QScrollArea *m_scrollArea;
    QWidget *m_contentWidget;
    int m_maxHeight = 600;
};

#endif // BASEWIDGET_H
