mirror of
https://github.com/ErikReider/SwayNotificationCenter.git
synced 2024-11-22 09:43:52 +03:00
Close notification with middle mouse button (#413)
* Close notification with middle mouse button Signed-off-by: Stian Onarheim <stian.onarheim@protonmail.com> * Fix linting issue --------- Signed-off-by: Stian Onarheim <stian.onarheim@protonmail.com> Co-authored-by: Erik Reider <35975961+ErikReider@users.noreply.github.com>
This commit is contained in:
parent
931bea2759
commit
653058beac
@ -257,7 +257,7 @@ To reload css after changes
|
||||
- Shift+D: Toggle Do Not Disturb
|
||||
- Buttons 1-9: Execute alternative actions
|
||||
- Left click button / actions: Activate notification action
|
||||
- Right click notification: Close notification
|
||||
- Middle/Right click notification: Close notification
|
||||
|
||||
## Configuring
|
||||
|
||||
|
@ -44,7 +44,7 @@ swaync - A simple notification daemon with a GTK gui for notifications and the c
|
||||
|
||||
*Left click button / actions*: Activate notification action
|
||||
|
||||
*Right click notification*: Close notification
|
||||
*Middle/Right click notification*: Close notification
|
||||
|
||||
# CONFIGURATION
|
||||
|
||||
|
@ -206,10 +206,15 @@ namespace SwayNotificationCenter {
|
||||
///
|
||||
|
||||
this.button_press_event.connect ((event) => {
|
||||
if (event.button != Gdk.BUTTON_SECONDARY) return false;
|
||||
// Right click
|
||||
this.close_notification ();
|
||||
return true;
|
||||
// Close notification on middle and right button click
|
||||
switch (event.button) {
|
||||
case Gdk.BUTTON_MIDDLE:
|
||||
case Gdk.BUTTON_SECONDARY:
|
||||
this.close_notification ();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// Adds CSS :hover selector to EventBox
|
||||
|
Loading…
Reference in New Issue
Block a user