Fix macOS popup y position, neglecting unneccesary calculations

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
This commit is contained in:
Dominique Fuchs 2020-01-04 12:08:30 +01:00
parent ff92adf3e0
commit ed9c06583a

View file

@ -131,6 +131,11 @@ int Systray::calcTrayWindowX()
}
int Systray::calcTrayWindowY()
{
#ifdef Q_OS_OSX
// macOS menu bar is always 22 (effective) pixels and at the top
// don't use availableGeometry() here, because this also excludes the dock
return 22+6;
#else
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QScreen *trayScreen = QGuiApplication::screenAt(this->geometry().topRight());
#else
@ -157,7 +162,7 @@ int Systray::calcTrayWindowY()
}
} else {
// tray icon is on the top
return (trayScreen->geometry().height() - trayScreen->availableGeometry().height()) + 6;
#endif
}
}
} // namespace OCC