feat(ags notifs): disable eventbox when sliding away

This commit is contained in:
matt1432 2023-10-28 18:47:39 -04:00
parent 0e4c446438
commit c4fee015d6
3 changed files with 17 additions and 8 deletions

View file

@ -12,11 +12,14 @@ const ClearButton = () => EventBox({
onPrimaryClickRelease: button => { onPrimaryClickRelease: button => {
button._popups.children.forEach(ch => { button._popups.children.forEach(ch => {
ch.child.setStyle(ch.child._leftAnim1); ch.child.setStyle(ch.child._leftAnim1);
ch.sensitive = false;
}); });
button._notifList.children.forEach(ch => { button._notifList.children.forEach(ch => {
if (ch.child) if (ch.child) {
ch.child.setStyle(ch.child._rightAnim1); ch.child.setStyle(ch.child._rightAnim1);
ch.sensitive = false;
}
timeout(500, () => { timeout(500, () => {
button._notifList.remove(ch); button._notifList.remove(ch);
Notifications.clear(); Notifications.clear();
@ -91,6 +94,7 @@ const NotificationList = Box({
for (const ch of box.children) { for (const ch of box.children) {
if (ch._id == id) { if (ch._id == id) {
ch.child.setStyle(ch.child._rightAnim1); ch.child.setStyle(ch.child._rightAnim1);
ch.sensitive = false;
timeout(500, () => box.remove(ch)); timeout(500, () => box.remove(ch));
return; return;
} }

View file

@ -113,11 +113,17 @@ export default ({
if (Math.abs(offset) > maxOffset) { if (Math.abs(offset) > maxOffset) {
if (offset > 0) { if (offset > 0) {
self.setStyle(rightAnim1); self.setStyle(rightAnim1);
Utils.timeout(500, () => self.setStyle(rightAnim2)); widget.sensitive = false;
Utils.timeout(500, () => {
self.setStyle(rightAnim2);
});
} }
else { else {
self.setStyle(leftAnim1); self.setStyle(leftAnim1);
Utils.timeout(500, () => self.setStyle(leftAnim2)); widget.sensitive = false;
Utils.timeout(500, () => {
self.setStyle(leftAnim2);
});
} }
Utils.timeout(1000, () => { Utils.timeout(1000, () => {
command(); command();

View file

@ -19,12 +19,11 @@ const Popups = () => Box({
box.get_parent().reveal_child = false; box.get_parent().reveal_child = false;
Utils.timeout(200, () => { Utils.timeout(200, () => {
if (box._map.get(id)?.interval) { const notif = box._map.get(id);
GLib.source_remove(box._map.get(id).interval); if (notif.interval) {
box._map.get(id).interval = undefined; GLib.source_remove(notif.interval);
notif.interval = undefined;
} }
box._map.get(id)?.destroy();
box._map.delete(id);
}); });
}], }],