From 46631b3a5836e18c93f1da09dfc7b62707bd6af6 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Fri, 15 Sep 2023 09:52:01 +0200 Subject: [PATCH] fix qt5 build --- .../toastnotificationsmanager.cpp | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/librssguard/gui/notifications/toastnotificationsmanager.cpp b/src/librssguard/gui/notifications/toastnotificationsmanager.cpp index b0599d234..cb6235d61 100644 --- a/src/librssguard/gui/notifications/toastnotificationsmanager.cpp +++ b/src/librssguard/gui/notifications/toastnotificationsmanager.cpp @@ -151,7 +151,18 @@ void ToastNotificationsManager::makeSpaceForNotification(int height_to_make_spac switch (m_position) { case ToastNotificationsManager::TopLeft: case ToastNotificationsManager::TopRight: { - std::function shift_down = reverse ? [](int x, int y) {return x - y;} : [](int x, int y) {return x + y;}; + std::function shift_down; + + if (reverse) { + shift_down = [](int x, int y) { + return x - y; + }; + } + else { + shift_down = [](int x, int y) { + return x + y; + }; + } // Move it all down. notif->move(notif->pos().x(), shift_down(notif->pos().y(), (height_to_make_space + NOTIFICATIONS_MARGIN))); @@ -160,7 +171,18 @@ void ToastNotificationsManager::makeSpaceForNotification(int height_to_make_spac case ToastNotificationsManager::BottomLeft: case ToastNotificationsManager::BottomRight: { - std::function shift_up = reverse ? [](int x, int y) {return x + y;} : [](int x, int y) {return x - y;}; + std::function shift_up; + + if (reverse) { + shift_up = [](int x, int y) { + return x + y; + }; + } + else { + shift_up = [](int x, int y) { + return x - y; + }; + } // Move it all up. notif->move(notif->pos().x(), shift_up(notif->pos().y(), height_to_make_space + NOTIFICATIONS_MARGIN));