diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index 04f55cd69..51c8c25c7 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -234,6 +234,36 @@ struct StickersListWidget::Sticker { void ensureMediaCreated(); }; +struct StickersListWidget::Set { + Set( + uint64 id, + Data::StickersSet *set, + Data::StickersSetFlags flags, + const QString &title, + const QString &shortName, + int count, + bool externalLayout, + std::vector &&stickers = {}); + Set(Set &&other); + Set &operator=(Set &&other); + ~Set(); + + uint64 id = 0; + Data::StickersSet *set = nullptr; + Data::StickersSetFlags flags; + QString title; + QString shortName; + std::vector stickers; + std::unique_ptr ripple; + crl::time lastUpdateTime = 0; + + std::unique_ptr lottiePlayer; + rpl::lifetime lottieLifetime; + + int count = 0; + bool externalLayout = false; +}; + auto StickersListWidget::PrepareStickers( const QVector &pack) -> std::vector { diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.h b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.h index 396a3b985..c583f6d81 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.h +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.h @@ -119,6 +119,7 @@ protected: private: class Footer; struct Sticker; + struct Set; enum class Section { Featured, @@ -184,35 +185,6 @@ private: int rowsBottom = 0; }; - struct Set { - Set( - uint64 id, - Data::StickersSet *set, - Data::StickersSetFlags flags, - const QString &title, - const QString &shortName, - int count, - bool externalLayout, - std::vector &&stickers = {}); - Set(Set &&other); - Set &operator=(Set &&other); - ~Set(); - - uint64 id = 0; - Data::StickersSet *set = nullptr; - Data::StickersSetFlags flags; - QString title; - QString shortName; - std::vector stickers; - std::unique_ptr ripple; - crl::time lastUpdateTime = 0; - - std::unique_ptr lottiePlayer; - rpl::lifetime lottieLifetime; - - int count = 0; - bool externalLayout = false; - }; struct FeaturedSet { uint64 id = 0; Data::StickersSetFlags flags; diff --git a/Telegram/SourceFiles/history/view/media/history_view_media_common.cpp b/Telegram/SourceFiles/history/view/media/history_view_media_common.cpp index 00f28fa0c..f091a6ba2 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_media_common.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_media_common.cpp @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/text/format_values.h" #include "data/data_document.h" #include "data/data_wall_paper.h" +#include "data/data_media_types.h" #include "history/view/history_view_element.h" #include "history/view/media/history_view_media_grouped.h" #include "history/view/media/history_view_photo.h" @@ -60,6 +61,13 @@ void PaintInterpolatedIcon( p.restore(); } +std::unique_ptr CreateAttach( + not_null parent, + DocumentData *document, + PhotoData *photo) { + return CreateAttach(parent, document, photo, {}, {}); +} + std::unique_ptr CreateAttach( not_null parent, DocumentData *document, diff --git a/Telegram/SourceFiles/history/view/media/history_view_media_common.h b/Telegram/SourceFiles/history/view/media/history_view_media_common.h index 09f663534..a16ccb017 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_media_common.h +++ b/Telegram/SourceFiles/history/view/media/history_view_media_common.h @@ -31,12 +31,16 @@ void PaintInterpolatedIcon( float64 b_ratio, QRect rect); -std::unique_ptr CreateAttach( +[[nodiscard]] std::unique_ptr CreateAttach( + not_null parent, + DocumentData *document, + PhotoData *photo); +[[nodiscard]] std::unique_ptr CreateAttach( not_null parent, DocumentData *document, PhotoData *photo, - const std::vector> &collage = {}, - const QString &webpageUrl = QString()); + const std::vector> &collage, + const QString &webpageUrl); int unitedLineHeight(); [[nodiscard]] inline QSize NonEmptySize(QSize size) {