close notifications with mouse right click
This commit is contained in:
parent
919547e586
commit
81c5a06bc9
@ -79,10 +79,18 @@ bool BaseToastNotification::eventFilter(QObject* watched, QEvent* event) {
|
||||
setupTimedClosing();
|
||||
}
|
||||
|
||||
if (event->type() == QEvent::Type::MouseButtonPress) {
|
||||
if (dynamic_cast<QMouseEvent*>(event)->button() == Qt::MouseButton::RightButton) {
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
return QDialog::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
void BaseToastNotification::closeEvent(QCloseEvent* event) {
|
||||
Q_UNUSED(event)
|
||||
|
||||
stopTimedClosing();
|
||||
emit closeRequested(this);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user