mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 07:03:08 +00:00
notifications: Don't factor action drawer state in expiry
Currently opening the action drawer causes notification popups to "expire", causing some unintended behaviour (ex. dismiss alarm/timer). This commit removes this behaviour, and also fixes notification popup expiry while the action drawer is open. Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/468
This commit is contained in:
parent
a83e99ae8c
commit
7f8c9f8d5e
1 changed files with 2 additions and 16 deletions
|
|
@ -50,7 +50,6 @@ Item {
|
|||
onTriggered: {
|
||||
visible = true;
|
||||
updateNotificationPopups();
|
||||
checkActionDrawerOpened();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +72,7 @@ Item {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
onTriggered: notificationPopup.closePopup(popupIndex)
|
||||
onTriggered: notificationPopup.closePopup(popupIndex);
|
||||
}
|
||||
|
||||
// the value of how much time is left, normalized from 1 to 0
|
||||
|
|
@ -180,9 +179,6 @@ Item {
|
|||
popupNotifications.currentPopupIndex = popupIndex;
|
||||
}
|
||||
}
|
||||
// if the action drawer opens, it is best to dismiss all popup notifications
|
||||
onIsActionDrawerOpenChanged: checkActionDrawerOpened()
|
||||
|
||||
property bool isActionDrawerOpen: MobileShellState.ShellDBusClient.isActionDrawerOpen
|
||||
|
||||
property bool waiting: true
|
||||
|
|
@ -214,16 +210,6 @@ Item {
|
|||
return model.timeout;
|
||||
}
|
||||
|
||||
// check if the action drawer is opened and the popup is fully created
|
||||
// if so, close the popup with a scale effect
|
||||
function checkActionDrawerOpened() {
|
||||
if (isActionDrawerOpen && popupNotifications.objectAt(popupIndex)) {
|
||||
notificationPopup.expired();
|
||||
keyboardInteractivity = LayerShell.Window.KeyboardInteractivityNone;
|
||||
notificationItem.state = "closeWithScale";
|
||||
}
|
||||
}
|
||||
|
||||
// show the top most notification in the list and move the rest to the popup drawer
|
||||
function updateNotificationPopups() {
|
||||
if (popupCount != 1) {
|
||||
|
|
@ -520,7 +506,7 @@ Item {
|
|||
notificationPopup.preventDismissTimeout = true;
|
||||
if (notificationPopup.dismissTimeout) {
|
||||
notificationPopup.dismissClicked();
|
||||
} else if (!notificationPopup.isActionDrawerOpen) {
|
||||
} else {
|
||||
notificationPopup.expired();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue