2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Implement nice topic icon create / edit box.

This commit is contained in:
John Preston
2022-10-06 17:06:18 +04:00
parent 3aa7f4dd62
commit 2c50f7b18c
22 changed files with 596 additions and 274 deletions

View File

@@ -113,6 +113,7 @@ QImage ForumTopicIconFrame(
if (const auto one = ExtractNonEmojiLetter(title); !one.isEmpty()) {
auto p = QPainter(&background);
p.setPen(Qt::white);
p.setFont(st.font);
p.drawText(
QRect(0, st.textTop, st.size, st.font->height * 2),
one,
@@ -331,7 +332,9 @@ void ForumTopic::paintUserpic(
const auto size = st::defaultForumTopicIcon.size;
const auto esize = st::emojiSize;
const auto shift = (esize - size) / 2;
p.drawImage(position + QPoint(shift, shift), _defaultIcon);
p.drawImage(
position + st::forumTopicIconPosition + QPoint(shift, 0),
_defaultIcon);
}
}