2018-01-14 21:55:36 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "basewidget.hpp"
|
|
|
|
|
2018-01-15 01:35:35 +01:00
|
|
|
class QHBoxLayout;
|
|
|
|
|
2018-01-14 21:55:36 +01:00
|
|
|
namespace chatterino {
|
|
|
|
namespace widgets {
|
|
|
|
|
|
|
|
class BaseWindow : public BaseWidget
|
|
|
|
{
|
|
|
|
public:
|
2018-01-15 01:35:35 +01:00
|
|
|
explicit BaseWindow(singletons::ThemeManager &_themeManager, QWidget *parent,
|
|
|
|
bool enableCustomFrame = false);
|
|
|
|
explicit BaseWindow(BaseWidget *parent, bool enableCustomFrame = false);
|
|
|
|
explicit BaseWindow(QWidget *parent = nullptr, bool enableCustomFrame = false);
|
|
|
|
|
|
|
|
QWidget *getLayoutContainer();
|
|
|
|
bool hasCustomWindowFrame();
|
|
|
|
void addTitleBarButton(const QString &text);
|
2018-01-14 21:55:36 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
#ifdef USEWINSDK
|
2018-01-15 01:35:35 +01:00
|
|
|
virtual void showEvent(QShowEvent *);
|
2018-01-14 21:55:36 +01:00
|
|
|
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
|
2018-01-15 01:35:35 +01:00
|
|
|
virtual void paintEvent(QPaintEvent *event) override;
|
2018-01-14 21:55:36 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
virtual void changeEvent(QEvent *) override;
|
|
|
|
virtual void leaveEvent(QEvent *) override;
|
|
|
|
|
2018-01-15 01:35:35 +01:00
|
|
|
virtual void refreshTheme() override;
|
|
|
|
|
2018-01-14 21:55:36 +01:00
|
|
|
private:
|
|
|
|
void init();
|
2018-01-15 01:35:35 +01:00
|
|
|
|
|
|
|
bool enableCustomFrame;
|
|
|
|
|
|
|
|
QHBoxLayout *titlebarBox;
|
|
|
|
QWidget *titleLabel;
|
|
|
|
QWidget *minButton;
|
|
|
|
QWidget *maxButton;
|
|
|
|
QWidget *exitButton;
|
|
|
|
QWidget *layoutBase;
|
|
|
|
std::vector<QWidget *> widgets;
|
2018-01-14 21:55:36 +01:00
|
|
|
};
|
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|