feat(ags notif center): close after clear all
This commit is contained in:
parent
865d44223c
commit
9bdb2f44b4
1 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
|||
import App from 'resource:///com/github/Aylur/ags/app.js';
|
||||
import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js';
|
||||
|
||||
import { Button, Label, Box, Icon, Scrollable, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
|
||||
import { timeout } from 'resource:///com/github/Aylur/ags/utils.js';
|
||||
|
||||
import { Notification, HasNotifs } from './base.js';
|
||||
import EventBox from '../misc/cursorbox.js';
|
||||
|
@ -53,7 +55,10 @@ const NotificationList = () => Box({
|
|||
// Needs to be wrapped to still have onHover when disabled
|
||||
const ClearButton = () => EventBox({
|
||||
child: Button({
|
||||
onPrimaryClickRelease: () => Notifications.clear(),
|
||||
onPrimaryClickRelease: () => {
|
||||
Notifications.clear();
|
||||
timeout(1000, () => App.closeWindow('notification-center'));
|
||||
},
|
||||
binds: [['sensitive', HasNotifs]],
|
||||
child: Box({
|
||||
children: [
|
||||
|
|
Loading…
Reference in a new issue