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

Support custom icon for General topic.

This commit is contained in:
John Preston
2022-11-29 17:25:18 +04:00
parent 57af221d39
commit ac3834bfdb
5 changed files with 79 additions and 8 deletions

View File

@@ -216,11 +216,17 @@ void TopicIconView::setupPlayer(not_null<Data::ForumTopic*> topic) {
}
void TopicIconView::setupImage(not_null<Data::ForumTopic*> topic) {
using namespace Data;
if (topic->isGeneral()) {
_image = ForumTopicGeneralIconFrame(
st::infoForumTopicIcon.size,
st::windowSubTextFg);
return;
}
rpl::combine(
TitleValue(topic),
ColorIdValue(topic)
) | rpl::map([=](const QString &title, int32 colorId) {
using namespace Data;
return ForumTopicIconFrame(colorId, title, st::infoForumTopicIcon);
}) | rpl::start_with_next([=](QImage &&image) {
_image = std::move(image);