Huge refactor
- Remove some underscore-prefixes
- Start using this-> more
- Remove a few of the singletons (We pass references to managers to
things that need it now. Might not be much better, but for now
it works. It also shows what places might be slightly wrong
designed)
This commit is contained in:
@@ -4,15 +4,24 @@
|
||||
#include <QString>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class EmoteManager;
|
||||
class WindowManager;
|
||||
|
||||
namespace messages {
|
||||
|
||||
class LazyLoadedImage : QObject
|
||||
{
|
||||
public:
|
||||
explicit LazyLoadedImage(const QString &_url, qreal _scale = 1, const QString &_name = "",
|
||||
LazyLoadedImage() = delete;
|
||||
|
||||
explicit LazyLoadedImage(EmoteManager &_emoteManager, WindowManager &_windowManager,
|
||||
const QString &_url, qreal _scale = 1, const QString &_name = "",
|
||||
const QString &_tooltip = "", const QMargins &_margin = QMargins(),
|
||||
bool isHat = false);
|
||||
explicit LazyLoadedImage(QPixmap *_currentPixmap, qreal _scale = 1, const QString &_name = "",
|
||||
|
||||
explicit LazyLoadedImage(EmoteManager &_emoteManager, WindowManager &_windowManager,
|
||||
QPixmap *_currentPixmap, qreal _scale = 1, const QString &_name = "",
|
||||
const QString &_tooltip = "", const QMargins &_margin = QMargins(),
|
||||
bool isHat = false);
|
||||
|
||||
@@ -78,6 +87,9 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
EmoteManager &emoteManager;
|
||||
WindowManager &windowManager;
|
||||
|
||||
struct FrameData {
|
||||
QPixmap *image;
|
||||
int duration;
|
||||
@@ -85,13 +97,13 @@ private:
|
||||
|
||||
QPixmap *_currentPixmap;
|
||||
std::vector<FrameData> _allFrames;
|
||||
int _currentFrame;
|
||||
int _currentFrameOffset;
|
||||
int _currentFrame = 0;
|
||||
int _currentFrameOffset = 0;
|
||||
|
||||
QString _url;
|
||||
QString _name;
|
||||
QString _tooltip;
|
||||
bool _animated;
|
||||
bool _animated = false;
|
||||
QMargins _margin;
|
||||
bool _ishat;
|
||||
qreal _scale;
|
||||
|
||||
Reference in New Issue
Block a user