2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Start topic profile cover design.

This commit is contained in:
John Preston
2022-10-14 20:53:06 +04:00
parent d4255bbfe4
commit 791addd0ee
10 changed files with 232 additions and 125 deletions

View File

@@ -149,6 +149,8 @@ struct TopicUpdate {
UnreadMentions = (1U << 2),
UnreadReactions = (1U << 3),
Notifications = (1U << 4),
Title = (1U << 5),
Icon = (1U << 6),
LastUsedBit = (1U << 4),
};

View File

@@ -443,6 +443,7 @@ void ForumTopic::applyTitle(const QString &title) {
_defaultIcon = QImage();
indexTitleParts();
updateChatListEntry();
session().changes().topicUpdated(this, UpdateFlag::Title);
}
DocumentId ForumTopic::iconId() const {
@@ -450,19 +451,21 @@ DocumentId ForumTopic::iconId() const {
}
void ForumTopic::applyIconId(DocumentId iconId) {
if (_iconId != iconId) {
_iconId = iconId;
_icon = iconId
? owner().customEmojiManager().create(
_iconId,
[=] { updateChatListEntry(); },
Data::CustomEmojiManager::SizeTag::Normal)
: nullptr;
if (iconId) {
_defaultIcon = QImage();
}
if (_iconId == iconId) {
return;
}
_iconId = iconId;
_icon = iconId
? owner().customEmojiManager().create(
_iconId,
[=] { updateChatListEntry(); },
Data::CustomEmojiManager::SizeTag::Normal)
: nullptr;
if (iconId) {
_defaultIcon = QImage();
}
updateChatListEntry();
session().changes().topicUpdated(this, UpdateFlag::Icon);
}
int32 ForumTopic::colorId() const {