Bugfix : When clicking ont it, close all but call notifications

Propagate delete signal from any popup to the main popup and point to it
This commit is contained in:
Julien Wadel 2020-07-06 17:08:16 +02:00
parent 15178dca97
commit a96b70addb
2 changed files with 7 additions and 2 deletions

View file

@ -181,6 +181,7 @@ QObject *Notifier::createNotification (Notifier::NotificationType type, QVariant
view->setGeometry(subWindow->geometry()); // Ensure to have sufficient space to both let painter do job without error, and stay behind popup
if(previousWrapper!=nullptr){ // Link objects in order to propagate events without having to store them
QObject::connect(previousWrapper, SIGNAL(deleteNotification(QVariant)), wrapperItem,SLOT(deleteNotificationSlot()));
QObject::connect(wrapperItem, SIGNAL(isOpened()), previousWrapper,SLOT(open()));
QObject::connect(wrapperItem, SIGNAL(isClosed()), previousWrapper,SLOT(close()));
QObject::connect(wrapperItem, &QObject::destroyed, previousWrapper, &QObject::deleteLater);

View file

@ -14,13 +14,17 @@ DesktopPopup {
default property alias _content: content.data
signal deleteNotification (var notification)
// Use as an intermediate between signal/slot without propagate the notification var : last signal parameter will be the last notification instance
function deleteNotificationSlot(){
deleteNotification(notification)
}
function _close (cb) {
if (cb) {
cb()
}
deleteNotification(notification)
deleteNotificationSlot();
}
Rectangle {