rename #2
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <boost/optional.hpp>
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
namespace singletons {
|
||||
class ThemeManager;
|
||||
} // namespace singletons
|
||||
|
||||
namespace widgets {
|
||||
|
||||
class BaseWindow;
|
||||
|
||||
class BaseWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BaseWidget(QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
virtual ~BaseWidget() override;
|
||||
|
||||
virtual float getScale() const;
|
||||
pajlada::Signals::Signal<float> scaleChanged;
|
||||
|
||||
void setOverrideScale(boost::optional<float>);
|
||||
boost::optional<float> getOverrideScale() const;
|
||||
|
||||
QSize getScaleIndependantSize() const;
|
||||
int getScaleIndependantWidth() const;
|
||||
int getScaleIndependantHeight() const;
|
||||
void setScaleIndependantSize(int width, int height);
|
||||
void setScaleIndependantSize(QSize);
|
||||
void setScaleIndependantWidth(int value);
|
||||
void setScaleIndependantHeight(int value);
|
||||
|
||||
protected:
|
||||
void childEvent(QChildEvent *) override;
|
||||
|
||||
virtual void scaleChangedEvent(float newScale);
|
||||
virtual void themeRefreshEvent();
|
||||
|
||||
virtual void showEvent(QShowEvent *) override;
|
||||
|
||||
void setScale(float value);
|
||||
|
||||
singletons::ThemeManager *themeManager;
|
||||
|
||||
private:
|
||||
void init();
|
||||
float scale = 1.f;
|
||||
boost::optional<float> overrideScale = boost::none;
|
||||
QSize scaleIndependantSize;
|
||||
|
||||
std::vector<BaseWidget *> widgets;
|
||||
|
||||
pajlada::Signals::Connection themeConnection;
|
||||
|
||||
friend class BaseWindow;
|
||||
};
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
Reference in New Issue
Block a user