mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-04 08:25:38 +00:00
Added initial ability to use credits icon as emoji.
This commit is contained in:
@@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
#include "ffmpeg/ffmpeg_frame_generator.h"
|
#include "ffmpeg/ffmpeg_frame_generator.h"
|
||||||
#include "chat_helpers/stickers_lottie.h"
|
#include "chat_helpers/stickers_lottie.h"
|
||||||
#include "storage/file_download.h" // kMaxFileInMemory
|
#include "storage/file_download.h" // kMaxFileInMemory
|
||||||
|
#include "ui/effects/credits_graphics.h"
|
||||||
#include "ui/widgets/fields/input_field.h"
|
#include "ui/widgets/fields/input_field.h"
|
||||||
#include "ui/text/custom_emoji_instance.h"
|
#include "ui/text/custom_emoji_instance.h"
|
||||||
#include "ui/text/text_custom_emoji.h"
|
#include "ui/text/text_custom_emoji.h"
|
||||||
@@ -963,6 +964,14 @@ uint64 CustomEmojiManager::coloredSetId() const {
|
|||||||
return _coloredSetId;
|
return _coloredSetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextWithEntities CustomEmojiManager::creditsEmoji(QMargins padding) {
|
||||||
|
return Ui::Text::SingleCustomEmoji(
|
||||||
|
registerInternalEmoji(
|
||||||
|
Ui::GenerateStars(st::normalFont->height, 1),
|
||||||
|
padding,
|
||||||
|
false));
|
||||||
|
}
|
||||||
|
|
||||||
QString CustomEmojiManager::registerInternalEmoji(
|
QString CustomEmojiManager::registerInternalEmoji(
|
||||||
QImage emoji,
|
QImage emoji,
|
||||||
QMargins padding,
|
QMargins padding,
|
||||||
|
@@ -99,6 +99,8 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] uint64 coloredSetId() const;
|
[[nodiscard]] uint64 coloredSetId() const;
|
||||||
|
|
||||||
|
[[nodiscard]] TextWithEntities creditsEmoji(QMargins padding = {});
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto kSizeCount = int(SizeTag::kCount);
|
static constexpr auto kSizeCount = int(SizeTag::kCount);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user