From 5e69e8130c9f207e5f8e3222841e7771c56ccd24 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 9 Apr 2017 04:10:32 +0200 Subject: Show volume as tray icon message Use a QTimer to prevent the messages to pile up on every volume change. Only show it when the timer isn't running. The timeout value of 500msecs is totally arbitrary. The mStarting thingy prevents showing the message twice while constructing (setupGui and readSettings). --- playerwidget.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'playerwidget.h') diff --git a/playerwidget.h b/playerwidget.h index f42a882..6ef5dd1 100644 --- a/playerwidget.h +++ b/playerwidget.h @@ -14,6 +14,7 @@ class QTextEdit; class QMediaPlayer; class QToolBar; class QAction; +class QTimer; class BeetPlayerProxy; class BeetView; class QSystemTrayIcon; @@ -45,6 +46,7 @@ class PlayerWidget : public QWidget { void doDeleteFiles(); void volumeUp(); void volumeDown(); + void showVolume(); void doFilter(); void clearFilter(); void reindex(); @@ -118,7 +120,10 @@ class PlayerWidget : public QWidget { quint64 mPlayListLength; QString mCurDir; QString mCurWinTitle; + QString mCurToolTip; QSystemTrayIcon *mTrayIcon; + QTimer *mVolumeTimer; + bool mStarting; }; #endif // PLAYERWIDGET_H -- cgit v1.2.3-70-g09d2