SDA-4659 - stack based on corner top and bottom (#2192)

This commit is contained in:
Kiran Niranjan 2024-09-03 12:18:23 +05:30 committed by GitHub
parent a11f031a88
commit abdea63edd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -164,7 +164,6 @@ export default class NotificationHandler {
}
let posY;
const stackOffset = 10; // Vertical offset for each stacked notification
switch (this.settings.startCorner) {
case 'upper-right':
@ -174,7 +173,7 @@ export default class NotificationHandler {
if (!windowExists(notificationWindow)) {
return;
}
const newY = posY + stackOffset * index;
const newY = posY + NOTIFICATION_STACK_HEIGHT * index;
const newX = this.settings.firstPos.x;
this.setWindowPosition(notificationWindow, newX, newY);
});
@ -186,7 +185,7 @@ export default class NotificationHandler {
if (!windowExists(notificationWindow)) {
return;
}
const newY = posY - stackOffset * index;
const newY = posY - NOTIFICATION_STACK_HEIGHT * index;
const newX = this.settings.firstPos.x;
this.setWindowPosition(notificationWindow, newX, newY);
});
@ -316,7 +315,21 @@ export default class NotificationHandler {
const newX = this.settings.firstPos.x;
if (this.isNotificationStacked) {
if (isReset) {
switch (this.settings.startCorner) {
case 'upper-right':
case 'upper-left':
newY = this.settings.corner.y + NOTIFICATION_STACK_HEIGHT * i;
break;
case 'lower-right':
case 'lower-left':
const posY = this.settings.firstPos.y;
newY = posY - NOTIFICATION_STACK_HEIGHT * i;
break;
}
} else {
newY = this.settings.firstPos.y + NOTIFICATION_STACK_HEIGHT * i;
}
} else {
const [, y] = notificationWindow.getPosition();