diff options
Diffstat (limited to 'src/plugins/General')
| -rw-r--r-- | src/plugins/General/statusicon/statusicon.cpp | 10 | ||||
| -rw-r--r-- | src/plugins/General/statusicon/statusicon.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/General/statusicon/statusicon.cpp b/src/plugins/General/statusicon/statusicon.cpp index 53d92f36f..4946a4ba2 100644 --- a/src/plugins/General/statusicon/statusicon.cpp +++ b/src/plugins/General/statusicon/statusicon.cpp @@ -54,7 +54,7 @@ StatusIcon::StatusIcon(Control *control, QObject *parent) settings.endGroup(); m_enabled = FALSE; QTimer::singleShot(200, this, SLOT(enable())); - + m_state = General::Stopped; } @@ -63,6 +63,7 @@ StatusIcon::~StatusIcon() void StatusIcon::setState(const uint &state) { + m_state = state; switch ((uint) state) { case General::Playing: @@ -106,7 +107,12 @@ void StatusIcon::trayActivated(QSystemTrayIcon::ActivationReason reason) if (reason == QSystemTrayIcon::Trigger) m_control->toggleVisibility(); else if (reason == QSystemTrayIcon::MiddleClick) - m_control->pause(); + { + if(m_state == General::Stopped) + m_control->play(); + else + m_control->pause(); + } } void StatusIcon::enable() diff --git a/src/plugins/General/statusicon/statusicon.h b/src/plugins/General/statusicon/statusicon.h index 549cf5f18..b6d8a3e04 100644 --- a/src/plugins/General/statusicon/statusicon.h +++ b/src/plugins/General/statusicon/statusicon.h @@ -53,6 +53,7 @@ private: bool m_enabled; int m_messageDelay; Control *m_control; + uint m_state; }; |
