2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Paint unread mention badge as an icon.

This commit is contained in:
John Preston
2022-01-26 14:47:23 +03:00
parent 2a99f1a1ef
commit 6207770120
14 changed files with 156 additions and 93 deletions

View File

@@ -293,19 +293,19 @@ void MainMenu::AccountButton::paintEvent(QPaintEvent *e) {
const auto string = (_unreadBadge > 99)
? "99+"
: QString::number(_unreadBadge);
auto unreadWidth = 0;
const auto skip = _st.itemPadding.right()
- st::mainMenu.itemToggleShift;
const auto unreadRight = width() - skip;
const auto unreadTop = (height() - _unreadSt.size) / 2;
Dialogs::Ui::paintUnreadCount(
const auto badge = Dialogs::Ui::PaintUnreadBadge(
p,
string,
unreadRight,
unreadTop,
_unreadSt,
&unreadWidth);
available -= unreadWidth + skip + st::mainMenu.itemStyle.font->spacew;
_unreadSt);
available -= badge.width()
+ skip
+ st::mainMenu.itemStyle.font->spacew;
} else {
available -= _st.itemPadding.right();
}