mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 07:33:52 +02:00
Don't add counter when icon theme has 'panel' icon
These icons should have a dot indicating unread messages, counter is redudant for them
This commit is contained in:
parent
a986d7a3d6
commit
2fe2105a5f
1 changed files with 18 additions and 1 deletions
|
@ -204,6 +204,13 @@ QIcon TrayIconGen(int counter, bool muted) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto iconName = GetTrayIconName(counter, muted);
|
const auto iconName = GetTrayIconName(counter, muted);
|
||||||
|
const auto panelIconName = GetPanelIconName(counter, muted);
|
||||||
|
|
||||||
|
if (iconName == panelIconName) {
|
||||||
|
const auto result = QIcon::fromTheme(iconName);
|
||||||
|
UpdateIconRegenerationNeeded(result, counter, muted, iconThemeName);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
QIcon result;
|
QIcon result;
|
||||||
QIcon systemIcon;
|
QIcon systemIcon;
|
||||||
|
@ -624,7 +631,17 @@ void MainWindow::psTrayMenuUpdated() {
|
||||||
|
|
||||||
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||||
void MainWindow::setSNITrayIcon(int counter, bool muted) {
|
void MainWindow::setSNITrayIcon(int counter, bool muted) {
|
||||||
if (IsIndicatorApplication()) {
|
const auto iconName = GetTrayIconName(counter, muted);
|
||||||
|
const auto panelIconName = GetPanelIconName(counter, muted);
|
||||||
|
|
||||||
|
if (iconName == panelIconName) {
|
||||||
|
if (_sniTrayIcon->iconName() == iconName) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_sniTrayIcon->setIconByName(iconName);
|
||||||
|
_sniTrayIcon->setToolTipIconByName(iconName);
|
||||||
|
} else if (IsIndicatorApplication()) {
|
||||||
if (!IsIconRegenerationNeeded(counter, muted)
|
if (!IsIconRegenerationNeeded(counter, muted)
|
||||||
&& _trayIconFile
|
&& _trayIconFile
|
||||||
&& _sniTrayIcon->iconName() == _trayIconFile->fileName()) {
|
&& _sniTrayIcon->iconName() == _trayIconFile->fileName()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue