2017-06-26 16:41:20 +02:00
|
|
|
#pragma once
|
2017-06-26 15:53:43 +02:00
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
#include <QWidget>
|
|
|
|
|
2017-09-22 00:50:43 +02:00
|
|
|
//#include "windowmanager.hpp"
|
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class ColorScheme;
|
|
|
|
|
|
|
|
namespace widgets {
|
|
|
|
|
|
|
|
class BaseWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-09-22 00:50:43 +02:00
|
|
|
// explicit BaseWidget(ColorScheme &_colorScheme, WindowManager &windowManager, QWidget
|
|
|
|
// *parent);
|
2017-07-02 14:28:37 +02:00
|
|
|
explicit BaseWidget(ColorScheme &_colorScheme, QWidget *parent);
|
|
|
|
|
|
|
|
explicit BaseWidget(BaseWidget *parent);
|
2017-06-26 16:41:20 +02:00
|
|
|
|
2017-12-17 16:45:15 +01:00
|
|
|
explicit BaseWidget(QWidget *parent = nullptr);
|
|
|
|
|
2017-06-26 16:41:20 +02:00
|
|
|
ColorScheme &colorScheme;
|
2017-07-02 14:28:37 +02:00
|
|
|
|
2017-09-22 00:50:43 +02:00
|
|
|
float getDpiMultiplier();
|
|
|
|
|
|
|
|
// protected:
|
|
|
|
// WindowManager &windowManager;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
#ifdef USEWINSDK
|
|
|
|
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
|
|
|
|
#endif
|
2017-12-18 00:54:17 +01:00
|
|
|
|
2017-12-18 02:47:01 +01:00
|
|
|
virtual void dpiMultiplierChanged(float oldDpi, float newDpi)
|
2017-12-18 00:54:17 +01:00
|
|
|
{
|
|
|
|
}
|
2017-09-23 18:37:51 +02:00
|
|
|
void initAsWindow();
|
2017-09-22 00:50:43 +02:00
|
|
|
|
2017-07-02 14:28:37 +02:00
|
|
|
private:
|
2017-09-22 00:50:43 +02:00
|
|
|
float dpiMultiplier = 1.f;
|
|
|
|
|
2017-07-02 14:28:37 +02:00
|
|
|
void init();
|
|
|
|
|
|
|
|
virtual void refreshTheme();
|
2017-06-26 16:41:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|