NotificationBox: Enable options to not show if reference widget is not active and refactor restricttoarea

This commit is contained in:
Abdullah Tahiri
2023-03-21 08:31:05 +01:00
committed by abdullahtahiriyo
parent d9de68334b
commit f0883512d5
3 changed files with 44 additions and 14 deletions

View File

@@ -991,17 +991,13 @@ void NotificationArea::showInNotificationArea()
msgw += QString::fromLatin1("</table></p>");
// Calculate the main window QRect in global screen coordinates.
auto mainwindow = getMainWindow();
auto mainwindowrect = mainwindow->rect();
auto globalmainwindowrect =
QRect(mainwindow->mapToGlobal(mainwindowrect.topLeft()), mainwindowrect.size());
NotificationBox::showText(this->mapToGlobal(QPoint()),
msgw,
getMainWindow(),
pImp->notificationExpirationTime,
pImp->minimumOnScreenTime,
globalmainwindowrect,
NotificationBox::OnlyIfReferenceActive |
NotificationBox::RestrictAreaToReference,
pImp->notificationWidth);
}
}