mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
adf3ff3075
cstdint) Make MessageElement to a class to fit better with the derived classes. Make MessageLayoutElement to a class to fit better with the derived classes. Remove virtual from override functions Replace all instances of boost::signals2 with pajlada::Signals. This lets us properly use clang code model to check for issues. Add missing virtual destructor to AbstractIrcServer Add missing virtual destructor to MessageLayoutElement Remove unused "connectedConnection" connection in TwitchChannel Fix typo in TrimChannelName function Fix typo in MessageParseArgs Replace some raw pointers with unique pointers where it made more sense. This allowed us to remove some manually written destructors whose only purpose was to delete that raw pointer. Reformat: Add namespace comments Reformat: Add empty empty lines between main namespace beginning and end Reformat: Re-order includes Reformat: Fix some includes that used quotes where they should use angle brackets Reformat: Replace some typedef's with using's Filter out more useless warnings
59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <QWidget>
|
|
#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(singletons::ThemeManager &_themeManager, QWidget *parent,
|
|
Qt::WindowFlags f = Qt::WindowFlags());
|
|
explicit BaseWidget(BaseWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
|
|
|
|
singletons::ThemeManager &themeManager;
|
|
|
|
float getScale() const;
|
|
pajlada::Signals::Signal<float> scaleChanged;
|
|
|
|
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();
|
|
|
|
void setScale(float value);
|
|
|
|
private:
|
|
void init();
|
|
float scale = 1.f;
|
|
QSize scaleIndependantSize;
|
|
|
|
std::vector<BaseWidget *> widgets;
|
|
|
|
static void setScaleRecursive(float scale, QObject *object);
|
|
|
|
friend class BaseWindow;
|
|
};
|
|
|
|
} // namespace widgets
|
|
} // namespace chatterino
|