Revert "Provide the same sizes for tray icon as for main window icon"

This reverts commit f9bf68461d.
This commit is contained in:
John Preston 2022-12-06 12:55:09 +04:00
parent 1be37a10b3
commit 48148a8cc3
1 changed files with 9 additions and 10 deletions

View File

@ -58,7 +58,7 @@ private:
const QString _mutePanelTrayIconName; const QString _mutePanelTrayIconName;
const QString _attentionPanelTrayIconName; const QString _attentionPanelTrayIconName;
const int _iconSizes[7]; const int _iconSizes[5];
bool _muted = true; bool _muted = true;
int32 _count = 0; int32 _count = 0;
@ -73,7 +73,7 @@ IconGraphic::IconGraphic()
: _panelTrayIconName("telegram-panel") : _panelTrayIconName("telegram-panel")
, _mutePanelTrayIconName("telegram-mute-panel") , _mutePanelTrayIconName("telegram-mute-panel")
, _attentionPanelTrayIconName("telegram-attention-panel") , _attentionPanelTrayIconName("telegram-attention-panel")
, _iconSizes{ 16, 22, 32, 48, 64, 128, 256 } { , _iconSizes{ 16, 22, 24, 32, 48 } {
} }
IconGraphic::~IconGraphic() = default; IconGraphic::~IconGraphic() = default;
@ -211,14 +211,13 @@ QIcon IconGraphic::trayIcon(int counter, bool muted) {
: st::trayCounterBg; : st::trayCounterBg;
const auto &fg = st::trayCounterFg; const auto &fg = st::trayCounterFg;
if (iconSize >= 22) { if (iconSize >= 22) {
const auto layerSize0 = iconSize * 0.66; const auto layerSize = (iconSize >= 48)
const auto layerSize1 = int(base::SafeRound(layerSize0)); ? 32
auto layerSize2 = 0.; : (iconSize >= 36)
const auto layerSize = layerSize1 % 2 ? 24
? std::modf(layerSize0, &layerSize2) >= 0.5 : (iconSize >= 32)
? layerSize1 + 1 ? 20
: layerSize1 - 1 : 16;
: layerSize1;
const auto layer = Window::GenerateCounterLayer({ const auto layer = Window::GenerateCounterLayer({
.size = layerSize, .size = layerSize,
.count = counter, .count = counter,