2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix tray icon counter on Linux.

Fixes #5525.
This commit is contained in:
John Preston
2019-01-10 17:55:56 +04:00
parent 2773a675d0
commit 3e7a688811
2 changed files with 5 additions and 1 deletions

View File

@@ -836,6 +836,8 @@ QImage MainWindow::iconWithCounter(int size, int count, style::color bg, style::
if (layer) {
if (size != 16 && size != 20 && size != 24) size = 32;
// platform/linux/main_window_linux depends on count used the same
// way for all the same (count % 1000) values.
QString cnt = (count < 1000) ? QString("%1").arg(count) : QString("..%1").arg(count % 100, 2, 10, QChar('0'));
QImage result(size, size, QImage::Format_ARGB32);
int32 cntSize = cnt.size();