From 81c5a06bc9c4a64f7c7c2738dbba98985f63ded5 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Fri, 3 Nov 2023 10:37:39 +0100 Subject: [PATCH] close notifications with mouse right click --- .../gui/notifications/basetoastnotification.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/librssguard/gui/notifications/basetoastnotification.cpp b/src/librssguard/gui/notifications/basetoastnotification.cpp index 7e2ea52e7..b54b6271b 100644 --- a/src/librssguard/gui/notifications/basetoastnotification.cpp +++ b/src/librssguard/gui/notifications/basetoastnotification.cpp @@ -79,10 +79,18 @@ bool BaseToastNotification::eventFilter(QObject* watched, QEvent* event) { setupTimedClosing(); } + if (event->type() == QEvent::Type::MouseButtonPress) { + if (dynamic_cast(event)->button() == Qt::MouseButton::RightButton) { + close(); + } + } + return QDialog::eventFilter(watched, event); } void BaseToastNotification::closeEvent(QCloseEvent* event) { + Q_UNUSED(event) + stopTimedClosing(); emit closeRequested(this); }