diff --git a/src/librssguard/definitions/definitions.h b/src/librssguard/definitions/definitions.h index 8f6e92fcf..d4d209815 100644 --- a/src/librssguard/definitions/definitions.h +++ b/src/librssguard/definitions/definitions.h @@ -102,10 +102,11 @@ #define WEB_BROWSER_SCROLL_STEP 50.0 #define MAX_NUMBER_OF_REDIRECTIONS 4 -#define NOTIFICATIONS_MARGIN 16 -#define NOTIFICATIONS_WIDTH 300 -#define NOTIFICATIONS_TIMEOUT 15s -#define NOTIFICATIONS_PAGE_SIZE 10 +#define NOTIFICATIONS_MARGIN 16 +#define NOTIFICATIONS_WIDTH 300 +#define NOTIFICATIONS_TIMEOUT 10s +#define NOTIFICATION_SHORT_TIMEOUT 3s +#define NOTIFICATIONS_PAGE_SIZE 10 #define GOOGLE_SEARCH_URL "https://www.google.com/search?q=%1&ie=utf-8&oe=utf-8" #define GOOGLE_SUGGEST_URL "http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=%1" diff --git a/src/librssguard/gui/notifications/articlelistnotification.cpp b/src/librssguard/gui/notifications/articlelistnotification.cpp index 331b7e247..54c738c56 100644 --- a/src/librssguard/gui/notifications/articlelistnotification.cpp +++ b/src/librssguard/gui/notifications/articlelistnotification.cpp @@ -66,7 +66,7 @@ ArticleListNotification::ArticleListNotification(QWidget* parent) } void ArticleListNotification::loadResults(const QHash>& new_messages) { - setupTimedClosing(); + setupTimedClosing(false); m_newMessages = new_messages; diff --git a/src/librssguard/gui/notifications/basetoastnotification.cpp b/src/librssguard/gui/notifications/basetoastnotification.cpp index f8620dd24..5b80cd439 100644 --- a/src/librssguard/gui/notifications/basetoastnotification.cpp +++ b/src/librssguard/gui/notifications/basetoastnotification.cpp @@ -67,9 +67,9 @@ void BaseToastNotification::stopTimedClosing() { } } -void BaseToastNotification::setupTimedClosing() { +void BaseToastNotification::setupTimedClosing(bool want_shorter_timeout) { if (m_timerId < 0) { - m_timerId = startTimer(NOTIFICATIONS_TIMEOUT); + m_timerId = startTimer(want_shorter_timeout ? NOTIFICATION_SHORT_TIMEOUT : NOTIFICATIONS_TIMEOUT); qDebugNN << LOGSEC_NOTIFICATIONS << "Starting timed closing for notification."; } @@ -81,7 +81,7 @@ bool BaseToastNotification::eventFilter(QObject* watched, QEvent* event) { } if (watched == this && event->type() == QEvent::Type::Leave) { - setupTimedClosing(); + setupTimedClosing(true); } if (event->type() == QEvent::Type::MouseButtonPress || event->type() == QEvent::Type::MouseButtonRelease) { diff --git a/src/librssguard/gui/notifications/basetoastnotification.h b/src/librssguard/gui/notifications/basetoastnotification.h index 44910422e..3d1639ef1 100644 --- a/src/librssguard/gui/notifications/basetoastnotification.h +++ b/src/librssguard/gui/notifications/basetoastnotification.h @@ -25,7 +25,7 @@ class BaseToastNotification : public QDialog { virtual void closeEvent(QCloseEvent* event); void setupHeading(QLabel* lbl); - void setupTimedClosing(); + void setupTimedClosing(bool want_shorter_timeout); void setupCloseButton(QAbstractButton* btn); void stopTimedClosing(); diff --git a/src/librssguard/gui/notifications/toastnotification.cpp b/src/librssguard/gui/notifications/toastnotification.cpp index 607387c6f..ee98efa0a 100644 --- a/src/librssguard/gui/notifications/toastnotification.cpp +++ b/src/librssguard/gui/notifications/toastnotification.cpp @@ -12,12 +12,12 @@ ToastNotification::ToastNotification(Notification::Event event, const GuiMessage& msg, const GuiAction& action, QWidget* parent) - : BaseToastNotification() { + : BaseToastNotification(parent) { m_ui.setupUi(this); setupHeading(m_ui.m_lblTitle); setupCloseButton(m_ui.m_btnClose); - setupTimedClosing(); + setupTimedClosing(false); loadNotification(event, msg, action); } diff --git a/src/librssguard/gui/settings/settingsnotifications.ui b/src/librssguard/gui/settings/settingsnotifications.ui index ec51b5f81..f58cc4dc2 100644 --- a/src/librssguard/gui/settings/settingsnotifications.ui +++ b/src/librssguard/gui/settings/settingsnotifications.ui @@ -119,7 +119,7 @@ - + Screen @@ -129,7 +129,7 @@ - + 99 @@ -143,7 +143,7 @@ - + % @@ -153,7 +153,7 @@ - + Opacity @@ -193,7 +193,6 @@ m_sbWidth m_sbMargin m_sbScreen - m_sbOpacity