mirror of https://github.com/procxx/kepka.git
parent
2773a675d0
commit
3e7a688811
|
@ -836,6 +836,8 @@ QImage MainWindow::iconWithCounter(int size, int count, style::color bg, style::
|
||||||
if (layer) {
|
if (layer) {
|
||||||
if (size != 16 && size != 20 && size != 24) size = 32;
|
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'));
|
QString cnt = (count < 1000) ? QString("%1").arg(count) : QString("..%1").arg(count % 100, 2, 10, QChar('0'));
|
||||||
QImage result(size, size, QImage::Format_ARGB32);
|
QImage result(size, size, QImage::Format_ARGB32);
|
||||||
int32 cntSize = cnt.size();
|
int32 cntSize = cnt.size();
|
||||||
|
|
|
@ -92,6 +92,8 @@ QImage _trayIconImageGen() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_trayIconImage = _trayIconImageBack;
|
_trayIconImage = _trayIconImageBack;
|
||||||
|
_trayIconMuted = muted;
|
||||||
|
_trayIconCount = counterSlice;
|
||||||
if (counter > 0) {
|
if (counter > 0) {
|
||||||
QPainter p(&_trayIconImage);
|
QPainter p(&_trayIconImage);
|
||||||
int32 layerSize = -16;
|
int32 layerSize = -16;
|
||||||
|
@ -116,7 +118,7 @@ QString _trayIconImageFile() {
|
||||||
const auto muted = Messenger::Instance().unreadBadgeMuted();
|
const auto muted = Messenger::Instance().unreadBadgeMuted();
|
||||||
const auto counterSlice = (counter >= 1000) ? (1000 + (counter % 100)) : counter;
|
const auto counterSlice = (counter >= 1000) ? (1000 + (counter % 100)) : counter;
|
||||||
|
|
||||||
QString name = cWorkingDir() + qsl("tdata/ticons/ico%1_%2_%3.png").arg(muted ? "mute" : "").arg(_trayIconSize).arg(counterSlice);
|
QString name = cWorkingDir() + qsl("tdata/ticons/icon%1_%2_%3.png").arg(muted ? "mute" : "").arg(_trayIconSize).arg(counterSlice);
|
||||||
QFileInfo info(name);
|
QFileInfo info(name);
|
||||||
if (info.exists()) return name;
|
if (info.exists()) return name;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue