close notifications with mouse right click
This commit is contained in:
parent
919547e586
commit
81c5a06bc9
1 changed files with 8 additions and 0 deletions
|
@ -79,10 +79,18 @@ bool BaseToastNotification::eventFilter(QObject* watched, QEvent* event) {
|
||||||
setupTimedClosing();
|
setupTimedClosing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event->type() == QEvent::Type::MouseButtonPress) {
|
||||||
|
if (dynamic_cast<QMouseEvent*>(event)->button() == Qt::MouseButton::RightButton) {
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return QDialog::eventFilter(watched, event);
|
return QDialog::eventFilter(watched, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseToastNotification::closeEvent(QCloseEvent* event) {
|
void BaseToastNotification::closeEvent(QCloseEvent* event) {
|
||||||
|
Q_UNUSED(event)
|
||||||
|
|
||||||
stopTimedClosing();
|
stopTimedClosing();
|
||||||
emit closeRequested(this);
|
emit closeRequested(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue