Fix counter paint when DPR != 1 in Linux tray

This commit is contained in:
Ilya Fedin 2022-12-09 14:50:44 +04:00 committed by John Preston
parent 2565b948d9
commit 3cb333d323

View file

@ -231,6 +231,7 @@ QIcon IconGraphic::trayIcon(
: st::trayCounterBg; : st::trayCounterBg;
const auto &fg = st::trayCounterFg; const auto &fg = st::trayCounterFg;
if (iconSize >= 22) { if (iconSize >= 22) {
const auto imageSize = dprSize(iconImage);
const auto layerSize = (iconSize >= 48) const auto layerSize = (iconSize >= 48)
? 32 ? 32
: (iconSize >= 36) : (iconSize >= 36)
@ -247,8 +248,8 @@ QIcon IconGraphic::trayIcon(
QPainter p(&iconImage); QPainter p(&iconImage);
p.drawImage( p.drawImage(
iconImage.width() - layer.width() - 1, imageSize.width() - layer.width() - 1,
iconImage.height() - layer.height() - 1, imageSize.height() - layer.height() - 1,
layer); layer);
} else { } else {
iconImage = Window::WithSmallCounter(std::move(iconImage), { iconImage = Window::WithSmallCounter(std::move(iconImage), {