X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Flegacysystemtray.cpp;h=9308798e923671f868c8172e25cbb6b510963036;hp=16700d60788db10c161b4e0b7c302ca8235a8e82;hb=1a9450ecc5eeb5f987ceac790be84dcced02f028;hpb=695758015a80eb8c158a9ac4c0f1c0b547e70df3 diff --git a/src/qtui/legacysystemtray.cpp b/src/qtui/legacysystemtray.cpp index 16700d60..9308798e 100644 --- a/src/qtui/legacysystemtray.cpp +++ b/src/qtui/legacysystemtray.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This file is free software; you can redistribute it and/or modify * @@ -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(); }