From 48148a8cc35e8387b8a34b6111676709225765ca Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 6 Dec 2022 12:55:09 +0400 Subject: [PATCH] Revert "Provide the same sizes for tray icon as for main window icon" This reverts commit f9bf68461d3d36c5b351b0f98b6aa0665c2455d1. --- .../SourceFiles/platform/linux/tray_linux.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/tray_linux.cpp b/Telegram/SourceFiles/platform/linux/tray_linux.cpp index 668a1c9988..ba2a6b7da1 100644 --- a/Telegram/SourceFiles/platform/linux/tray_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/tray_linux.cpp @@ -58,7 +58,7 @@ private: const QString _mutePanelTrayIconName; const QString _attentionPanelTrayIconName; - const int _iconSizes[7]; + const int _iconSizes[5]; bool _muted = true; int32 _count = 0; @@ -73,7 +73,7 @@ IconGraphic::IconGraphic() : _panelTrayIconName("telegram-panel") , _mutePanelTrayIconName("telegram-mute-panel") , _attentionPanelTrayIconName("telegram-attention-panel") -, _iconSizes{ 16, 22, 32, 48, 64, 128, 256 } { +, _iconSizes{ 16, 22, 24, 32, 48 } { } IconGraphic::~IconGraphic() = default; @@ -211,14 +211,13 @@ QIcon IconGraphic::trayIcon(int counter, bool muted) { : st::trayCounterBg; const auto &fg = st::trayCounterFg; if (iconSize >= 22) { - const auto layerSize0 = iconSize * 0.66; - const auto layerSize1 = int(base::SafeRound(layerSize0)); - auto layerSize2 = 0.; - const auto layerSize = layerSize1 % 2 - ? std::modf(layerSize0, &layerSize2) >= 0.5 - ? layerSize1 + 1 - : layerSize1 - 1 - : layerSize1; + const auto layerSize = (iconSize >= 48) + ? 32 + : (iconSize >= 36) + ? 24 + : (iconSize >= 32) + ? 20 + : 16; const auto layer = Window::GenerateCounterLayer({ .size = layerSize, .count = counter,