From 39b3217dd30bbb3cedeca66206aaa997508550ce Mon Sep 17 00:00:00 2001 From: ilya-fedin Date: Thu, 9 Dec 2021 09:11:31 +0400 Subject: [PATCH] Allow to set custom icon on Mac in native way (#264) --- Telegram/SourceFiles/window/main_window.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index 3d21f04af..b55994411 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -149,6 +149,14 @@ QIcon CreateOfficialIcon(Main::Session *session) { } QIcon CreateIcon(Main::Session *session) { + if constexpr (Platform::IsMac()) { + if ((!session || !session->supportMode()) + && (cCustomAppIcon() == 0) + && !QFileInfo::exists(cWorkingDir() + "tdata/icon.png")) { + return QIcon(); + } + } + auto result = CreateOfficialIcon(session); #if defined Q_OS_UNIX && !defined Q_OS_MAC