fix qt5 build

This commit is contained in:
Martin Rotter 2023-09-15 09:52:01 +02:00
parent 28b6547da6
commit 46631b3a58

View File

@ -151,7 +151,18 @@ void ToastNotificationsManager::makeSpaceForNotification(int height_to_make_spac
switch (m_position) {
case ToastNotificationsManager::TopLeft:
case ToastNotificationsManager::TopRight: {
std::function<int(int,int)> shift_down = reverse ? [](int x, int y) {return x - y;} : [](int x, int y) {return x + y;};
std::function<int(int, int)> 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<int(int,int)> shift_up = reverse ? [](int x, int y) {return x + y;} : [](int x, int y) {return x - y;};
std::function<int(int, int)> 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));