fix(ags notif): fix hover and dismiss
This commit is contained in:
parent
4da8a529e0
commit
f8b0d3232e
2 changed files with 18 additions and 10 deletions
|
@ -46,15 +46,19 @@ export default ({
|
|||
const widget = EventBox({
|
||||
...props,
|
||||
cursor: 'grab',
|
||||
on_hover: (self) => {
|
||||
if (!self.attribute.hovered) {
|
||||
self.attribute.hovered = true;
|
||||
}
|
||||
},
|
||||
on_hover_lost: (self) => {
|
||||
|
||||
setup: (self) => {
|
||||
self
|
||||
.on('leave-notify-event', () => {
|
||||
if (self.attribute.hovered) {
|
||||
self.attribute.hovered = false;
|
||||
}
|
||||
})
|
||||
.on('enter-notify-event', () => {
|
||||
if (!self.attribute.hovered) {
|
||||
self.attribute.hovered = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
attribute: {
|
||||
|
|
|
@ -25,7 +25,11 @@ export default () => Box({
|
|||
if (notif) {
|
||||
const NewNotif = Notification({
|
||||
notif,
|
||||
command: () => notif.dismiss(),
|
||||
command: () => {
|
||||
if (notif.popup) {
|
||||
notif.dismiss();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
if (NewNotif) {
|
||||
|
|
Loading…
Reference in a new issue