mirror-chatterino2/src/widgets/basewidget.hpp

41 lines
825 B
C++
Raw Normal View History

#pragma once
#include <QWidget>
namespace chatterino {
2017-12-31 22:58:35 +01:00
namespace singletons {
2017-12-31 00:50:07 +01:00
class ThemeManager;
2017-12-31 22:58:35 +01:00
}
namespace widgets {
class BaseWidget : public QWidget
{
Q_OBJECT
public:
explicit BaseWidget(singletons::ThemeManager &_themeManager, QWidget *parent,
Qt::WindowFlags f = Qt::WindowFlags());
explicit BaseWidget(BaseWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
explicit BaseWidget(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
2017-12-17 16:45:15 +01:00
2017-12-31 22:58:35 +01:00
singletons::ThemeManager &themeManager;
2017-09-22 00:50:43 +02:00
float getDpiMultiplier();
protected:
virtual void dpiMultiplierChanged(float /*oldDpi*/, float /*newDpi*/)
{
}
2017-09-22 00:50:43 +02:00
float dpiMultiplier = 1.f;
2018-01-24 20:35:26 +01:00
virtual void refreshTheme();
private:
void init();
};
} // namespace widgets
} // namespace chatterino