Here is a patch I made that adds two features that I miss in SMPlayer :
- support the mouse wheel on tray icon (X11 only), either to change volume or current track
- customize mouse actions on tray icon, so that the left click and middle click can be changed to do different things (mute/unmute, play/pause, show/hide)
You can see how it works in the attached capture. It shows the default settings.
Click actions can be set to :
- Do nothing
Mouse wheel options are :
- Do nothing
- Volume up/down
- Next/previous track
The mouse wheel combo is greyed out on non-X11 platforms (Mac OS X, Windows, etc.). The customization should work as expected though.
Technical details :
- To ease the synchronization betwen the preferences dialog and the options menu ("Show icon in system tray"), the show_icon_tray setting is added to class Preferences, and changed whenever the checkbox is changed in the menu through a new slot, BaseGuiPlus::setTrayVisibility().
- The preferences dialog's applied() signal is now connected to a new slot, BaseGui::handlePreferences(), which will read the update pref and call applyNewPreferences(), so that we can properly subclass applyNewPreferences() in BaseGuiPlus to update tray settings.
- Qt requires us to subclass QSystemTrayIcon to handle mouse wheel events, which is done in class MyTrayIcon. It provides an additional signal wheel() to report for mouse wheel events.
Log in to post a comment.