[Dialog] Add CriticalNotification type

Allows to flag a dialog window as critical notification that should be shown even on top of fullscreen windows

Differential Revision: https://phabricator.kde.org/D20630
This commit is contained in:
Kai Uwe Broulik 2019-05-02 10:15:57 +02:00
parent d82a27d395
commit 91024027b0
2 changed files with 5 additions and 4 deletions

View File

@ -308,7 +308,7 @@ void DialogPrivate::updateVisibility(bool visible)
}
}
if (!q->flags().testFlag(Qt::ToolTip) && type != Dialog::Notification) {
if (!q->flags().testFlag(Qt::ToolTip) && type != Dialog::Notification && type != Dialog::CriticalNotification) {
KWindowEffects::SlideFromLocation slideLocation = KWindowEffects::NoEdge;
switch (location) {
@ -341,7 +341,7 @@ void DialogPrivate::updateVisibility(bool visible)
q->setFlags(Qt::FramelessWindowHint | q->flags());
}
if (type == Dialog::Dock || type == Dialog::Notification || type == Dialog::OnScreenDisplay) {
if (type == Dialog::Dock || type == Dialog::Notification || type == Dialog::OnScreenDisplay || type == Dialog::CriticalNotification) {
KWindowSystem::setOnAllDesktops(q->winId(), true);
} else {
KWindowSystem::setOnAllDesktops(q->winId(), false);
@ -1091,7 +1091,7 @@ void Dialog::setType(WindowType type)
}
}
if (type == Dock || type == Notification || type == OnScreenDisplay) {
if (type == Dock || type == Notification || type == OnScreenDisplay || type == CriticalNotification) {
KWindowSystem::setOnAllDesktops(winId(), true);
} else {
KWindowSystem::setOnAllDesktops(winId(), false);

View File

@ -157,7 +157,8 @@ public:
PopupMenu = NET::PopupMenu,
Tooltip = NET::Tooltip,
Notification = NET::Notification,
OnScreenDisplay = NET::OnScreenDisplay
OnScreenDisplay = NET::OnScreenDisplay,
CriticalNotification = NET::CriticalNotification
};
Q_ENUM(WindowType)