diff --git a/src/librssguard/gui/notifications/basetoastnotification.cpp b/src/librssguard/gui/notifications/basetoastnotification.cpp index 1976557a0..7e2ea52e7 100644 --- a/src/librssguard/gui/notifications/basetoastnotification.cpp +++ b/src/librssguard/gui/notifications/basetoastnotification.cpp @@ -33,6 +33,10 @@ BaseToastNotification::BaseToastNotification(QWidget* parent) : QDialog(parent), BaseToastNotification::~BaseToastNotification() {} +void BaseToastNotification::reject() { + close(); +} + void BaseToastNotification::setupCloseButton(QAbstractButton* btn) { btn->setToolTip(tr("Close this notification")); btn->setIcon(qApp->icons()->fromTheme(QSL("dialog-close"), QSL("gtk-close"))); @@ -67,20 +71,15 @@ void BaseToastNotification::setupTimedClosing() { } bool BaseToastNotification::eventFilter(QObject* watched, QEvent* event) { - if (event->type() == QEvent::Type::KeyPress) { - return true; + if (event->type() == QEvent::Type::Enter) { + stopTimedClosing(); } - else { - if (event->type() == QEvent::Type::Enter) { - stopTimedClosing(); - } - if (event->type() == QEvent::Type::Leave) { - setupTimedClosing(); - } - - return QDialog::eventFilter(watched, event); + if (event->type() == QEvent::Type::Leave) { + setupTimedClosing(); } + + return QDialog::eventFilter(watched, event); } void BaseToastNotification::closeEvent(QCloseEvent* event) { @@ -88,8 +87,6 @@ void BaseToastNotification::closeEvent(QCloseEvent* event) { emit closeRequested(this); } -void BaseToastNotification::reject() {} - void BaseToastNotification::timerEvent(QTimerEvent* event) { if (event->timerId() == m_timerId) { stopTimedClosing(); diff --git a/src/librssguard/gui/notifications/toastnotificationsmanager.cpp b/src/librssguard/gui/notifications/toastnotificationsmanager.cpp index 9edf8aa2f..de05eb3cd 100644 --- a/src/librssguard/gui/notifications/toastnotificationsmanager.cpp +++ b/src/librssguard/gui/notifications/toastnotificationsmanager.cpp @@ -109,7 +109,9 @@ void ToastNotificationsManager::showNotification(Notification::Event event, m_activeNotifications.prepend(notif); } -void ToastNotificationsManager::openArticleInArticleList(Feed* feed, const Message& msg) {} +void ToastNotificationsManager::openArticleInArticleList(Feed* feed, const Message& msg) { + // qApp -, ao +} void ToastNotificationsManager::closeNotification(BaseToastNotification* notif, bool delete_from_memory) { auto notif_idx = m_activeNotifications.indexOf(notif); @@ -164,11 +166,10 @@ void ToastNotificationsManager::initializeArticleListNotification() { m_articleListNotification = new ArticleListNotification(); hookNotification(m_articleListNotification); - /* connect(m_articleListNotification, &ArticleListNotification::openingArticleInArticleListRequested, this, - &ArticleListNotification::)*/ + &ToastNotificationsManager::openArticleInArticleList); } void ToastNotificationsManager::hookNotification(BaseToastNotification* notif) {