Close control center when clearing all notifications (#53)

* Close control center when clearing all notifications

* make hide on clear configurable, disabled by default
This commit is contained in:
Luca Berneking 2022-01-08 15:42:13 +01:00 committed by GitHub
parent c345804df8
commit 37142fcb37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 1 deletions

View File

@ -93,6 +93,7 @@ To reload the config, you'll need to run `swaync-client --reload-config`
- `image-visibility`: `always`, `when-available` or `never`. Notification image visiblilty
- `transition-time`: uint (Any positive number, 0 to disable). The notification animation duration
- `notification-window-width`: uint (Any positive number). Width of the notification in pixels
- `hide-on-clear`: bool. Hides the control center after pressing "Clear All"
The main CSS style file is located in `/etc/xdg/swaync/style.css`. Copy it over to your `.config/swaync/` folder to customize without needing root access.

View File

@ -7,5 +7,6 @@
"notification-window-width": 500,
"keyboard-shortcuts": true,
"image-visibility": "always",
"transition-time": 200
"transition-time": 200,
"hide-on-clear": false
}

View File

@ -149,6 +149,11 @@ namespace SwayNotificatonCenter {
*/
public int notification_window_width { get; set; default = 500; }
/*
* Hides the control center after clearing all notifications
*/
public bool hide_on_clear { get; set; default = false; }
/* Methods */
/**

View File

@ -218,6 +218,10 @@ namespace SwayNotificatonCenter {
} catch (Error e) {
stderr.printf (e.message + "\n");
}
if (ConfigModel.instance.hide_on_clear) {
this.set_visibility (false);
}
}
private void navigate_list (uint i) {