зеркало из https://github.com/nextcloud/desktop.git
No longer assume status bar height, calculate, fixing notch borking
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
This commit is contained in:
Родитель
be21f036ff
Коммит
655a2e1c39
|
@ -389,8 +389,9 @@ QRect Systray::taskbarGeometry() const
|
|||
return tbRect;
|
||||
#elif defined(Q_OS_MACOS)
|
||||
// Finder bar is always 22px height on macOS (when treating as effective pixels)
|
||||
auto screenWidth = currentScreenRect().width();
|
||||
return {0, 0, screenWidth, 22};
|
||||
const auto screenWidth = currentScreenRect().width();
|
||||
const auto statusBarHeight = static_cast<int>(OCC::statusBarThickness());
|
||||
return {0, 0, screenWidth, statusBarHeight};
|
||||
#else
|
||||
if (taskbarOrientation() == TaskBarPosition::Bottom || taskbarOrientation() == TaskBarPosition::Top) {
|
||||
auto screenWidth = currentScreenRect().width();
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
bool canOsXSendUserNotification();
|
||||
void sendOsXUserNotification(const QString &title, const QString &message);
|
||||
void setTrayWindowLevelAndVisibleOnAllSpaces(QWindow *window);
|
||||
double statusBarThickness();
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,6 +17,11 @@
|
|||
|
||||
namespace OCC {
|
||||
|
||||
double statusBarThickness()
|
||||
{
|
||||
return [NSStatusBar systemStatusBar].thickness;
|
||||
}
|
||||
|
||||
bool canOsXSendUserNotification()
|
||||
{
|
||||
return NSClassFromString(@"NSUserNotificationCenter") != nil;
|
||||
|
|
Загрузка…
Ссылка в новой задаче