From a240ae5b84a44a692b334399bb7eb805b5134c47 Mon Sep 17 00:00:00 2001 From: ilya-fedin Date: Mon, 4 May 2020 18:42:59 +0400 Subject: [PATCH] Custom icons should have priority (#35) --- .../SourceFiles/platform/linux/main_window_linux.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 4c28b96df..3cac655c2 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -177,7 +177,11 @@ QIcon TrayIconGen(int counter, bool muted) { if (currentImageBack.isNull() || iconThemeName != TrayIconThemeName || iconName != TrayIconName) { - if (!iconName.isEmpty()) { + if (QFileInfo::exists(cWorkingDir() + "tdata/icon.png")) { + currentImageBack = QImage(cWorkingDir() + "tdata/icon.png"); + } else if (cCustomAppIcon() != 0) { + currentImageBack = Core::App().logo(cCustomAppIcon()); + } else if (!iconName.isEmpty()) { if (systemIcon.isNull()) { systemIcon = QIcon::fromTheme(iconName); } @@ -199,10 +203,7 @@ QIcon TrayIconGen(int counter, bool muted) { .toImage(); } } else { - currentImageBack = QImage(cWorkingDir() + "tdata/icon.png"); - if (currentImageBack.isNull()) { - currentImageBack = Core::App().logo(cCustomAppIcon()); - } + currentImageBack = Core::App().logo(); } if (currentImageBack.size() != desiredSize) {