2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Palette usage improvements.

This commit is contained in:
John Preston
2016-10-31 15:29:26 +03:00
parent dbb6371e67
commit e08f5437a6
101 changed files with 1105 additions and 1045 deletions

View File

@@ -103,7 +103,9 @@ QImage _trayIconImageGen() {
} else if (_trayIconSize >= 32) {
layerSize = -20;
}
QImage layer = App::wnd()->iconWithCounter(layerSize, counter, (muted ? st::counterMuteBg : st::counterBg), false);
auto &bg = (muted ? st::trayCounterBgMute : st::trayCounterBg);
auto &fg = st::trayCounterFg;
auto layer = App::wnd()->iconWithCounter(layerSize, counter, bg, fg, false);
p.drawImage(_trayIconImage.width() - layer.width() - 1, _trayIconImage.height() - layer.height() - 1, layer);
}
}
@@ -355,9 +357,10 @@ void MainWindow::psUpdateCounter() {
int32 counter = App::histories().unreadBadge();
bool muted = App::histories().unreadOnlyMuted();
auto &bg = (muted ? st::counterMuteBg : st::counterBg);
icon.addPixmap(App::pixmapFromImageInPlace(iconWithCounter(16, counter, bg, true)));
icon.addPixmap(App::pixmapFromImageInPlace(iconWithCounter(32, counter, bg, true)));
auto &bg = (muted ? st::trayCounterBgMute : st::trayCounterBg);
auto &fg = st::trayCounterFg;
icon.addPixmap(App::pixmapFromImageInPlace(iconWithCounter(16, counter, bg, fg, true)));
icon.addPixmap(App::pixmapFromImageInPlace(iconWithCounter(32, counter, bg, fg, true)));
}
trayIcon->setIcon(icon);
}

View File

@@ -60,7 +60,7 @@ public:
bool psHasNativeNotifications();
virtual QImage iconWithCounter(int size, int count, const style::color &bg, bool smallIcon) = 0;
virtual QImage iconWithCounter(int size, int count, const style::color &bg, const style::color &fg, bool smallIcon) = 0;
static void LibsLoaded();