Remove "custom on success" logic from Image.

Create a new message element and message layout element type for mod badges.
This commit is contained in:
Rasmus Karlsson
2019-09-08 11:30:06 +02:00
committed by fourtf
parent 256a65a12e
commit dbce128cc3
8 changed files with 84 additions and 53 deletions
-6
View File
@@ -68,18 +68,13 @@ public:
bool operator==(const Image &image) const;
bool operator!=(const Image &image) const;
ImagePtr setCustomOnSuccess(
std::function<Outcome(ImagePtr, NetworkResult)> onSuccess);
private:
Image();
Image(const Url &url, qreal scale);
Image(qreal scale);
public:
void setPixmap(const QPixmap &pixmap);
private:
void actuallyLoad();
Url url_{};
@@ -88,6 +83,5 @@ private:
bool shouldLoad_{false};
std::unique_ptr<detail::Frames> frames_{};
QObject object_{};
std::function<Outcome(ImagePtr, NetworkResult)> customOnSuccess_{};
};
} // namespace chatterino