X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Flegacysystemtray.cpp;h=9308798e923671f868c8172e25cbb6b510963036;hp=2166c4ee6ac94479cb71dde5b8f3c2fb19d51ebf;hb=1a9450ecc5eeb5f987ceac790be84dcced02f028;hpb=8c14f3be78d107d77a9f6e3bbf4175f5e0c5cbc6 diff --git a/src/qtui/legacysystemtray.cpp b/src/qtui/legacysystemtray.cpp index 2166c4ee..9308798e 100644 --- a/src/qtui/legacysystemtray.cpp +++ b/src/qtui/legacysystemtray.cpp @@ -65,7 +65,7 @@ void LegacySystemTray::init() void LegacySystemTray::syncLegacyIcon() { - _trayIcon->setIcon(stateIcon()); + updateIcon(); #if defined Q_OS_MAC || defined Q_OS_WIN QString tooltip = QString("%1").arg(toolTipTitle()); @@ -137,23 +137,25 @@ void LegacySystemTray::setState(State state_) _blinkState = false; } } - if (mode() == Legacy) - _trayIcon->setIcon(stateIcon()); + updateIcon(); } -QIcon LegacySystemTray::stateIcon() const +void LegacySystemTray::updateIcon() { - if (mode() == Legacy && state() == NeedsAttention && !_blinkState) - return SystemTray::stateIcon(Active); - return SystemTray::stateIcon(); + if (state() == State::NeedsAttention && !_blinkState) { + _trayIcon->setIcon(QIcon::fromTheme(iconName(State::Active))); + } + else { + _trayIcon->setIcon(QIcon::fromTheme(iconName(state()))); + } } void LegacySystemTray::on_blinkTimeout() { _blinkState = !_blinkState; - _trayIcon->setIcon(stateIcon()); + updateIcon(); }