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 => {
button._popups.children.forEach(ch => {
ch.child.setStyle(ch.child._leftAnim1);
ch.sensitive = false;
});
button._notifList.children.forEach(ch => {
if (ch.child)
if (ch.child) {
ch.child.setStyle(ch.child._rightAnim1);
ch.sensitive = false;
}
timeout(500, () => {
button._notifList.remove(ch);
Notifications.clear();
@ -91,6 +94,7 @@ const NotificationList = Box({
for (const ch of box.children) {
if (ch._id == id) {
ch.child.setStyle(ch.child._rightAnim1);
ch.sensitive = false;
timeout(500, () => box.remove(ch));
return;
}

View file

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

View file

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