Added right click to close notification (#110)
This commit is contained in:
@@ -104,6 +104,8 @@ To reload css after changes
|
|||||||
- Shift+C: Close all notifications
|
- Shift+C: Close all notifications
|
||||||
- Shift+D: Toggle Do Not Disturb
|
- Shift+D: Toggle Do Not Disturb
|
||||||
- Buttons 1-9: Execute alternative actions
|
- Buttons 1-9: Execute alternative actions
|
||||||
|
- Left click button / actions: Activate notification action
|
||||||
|
- Right click notification: Close notification
|
||||||
|
|
||||||
## Configuring
|
## Configuring
|
||||||
|
|
||||||
|
@@ -42,6 +42,10 @@ swaync - A simple notification daemon with a GTK gui for notifications and the c
|
|||||||
|
|
||||||
*Buttons 1-9*: Execute alternative actions
|
*Buttons 1-9*: Execute alternative actions
|
||||||
|
|
||||||
|
*Left click button / actions*: Activate notification action
|
||||||
|
|
||||||
|
*Right click notification*: Close notification
|
||||||
|
|
||||||
# CONFIGURATION
|
# CONFIGURATION
|
||||||
|
|
||||||
The main config file is located in */etc/xdg/swaync/config.json*. Copy it over
|
The main config file is located in */etc/xdg/swaync/config.json*. Copy it over
|
||||||
|
@@ -79,6 +79,13 @@ namespace SwayNotificationCenter {
|
|||||||
|
|
||||||
this.summary.set_text (param.summary ?? param.app_name);
|
this.summary.set_text (param.summary ?? param.app_name);
|
||||||
|
|
||||||
|
this.button_press_event.connect ((event) => {
|
||||||
|
if (event.button != Gdk.BUTTON_SECONDARY) return false;
|
||||||
|
// Right click
|
||||||
|
this.close_notification ();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
default_button.clicked.connect (click_default_action);
|
default_button.clicked.connect (click_default_action);
|
||||||
|
|
||||||
close_revealer.set_transition_duration (this.transition_time);
|
close_revealer.set_transition_duration (this.transition_time);
|
||||||
|
Reference in New Issue
Block a user