Add TDESKTOP_FORCE_PANEL_ICON environment variable for possibility to use system icon even if it is not detected

This commit is contained in:
Ilya Fedin 2020-03-12 16:49:04 +04:00 committed by John Preston
parent ba5d9eda2d
commit 75d54adfce
1 changed files with 3 additions and 1 deletions

View File

@ -37,6 +37,7 @@ namespace Platform {
namespace {
constexpr auto kDisableTrayCounter = "TDESKTOP_DISABLE_TRAY_COUNTER"_cs;
constexpr auto kForcePanelIcon = "TDESKTOP_FORCE_PANEL_ICON"_cs;
constexpr auto kPanelTrayIconName = "telegram-panel"_cs;
constexpr auto kMutePanelTrayIconName = "telegram-mute-panel"_cs;
constexpr auto kAttentionPanelTrayIconName = "telegram-attention-panel"_cs;
@ -356,7 +357,8 @@ void MainWindow::setSNITrayIcon(int counter, bool muted, bool firstShow) {
const auto iconName = GetTrayIconName(counter, muted);
if (qEnvironmentVariableIsSet(kDisableTrayCounter.utf8())
&& !iconName.isEmpty()) {
&& (!iconName.isEmpty()
|| qEnvironmentVariableIsSet(kForcePanelIcon.utf8()))) {
if (_sniTrayIcon->iconName() == iconName) {
return;
}