Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorClaudio Cambra <claudio.cambra@gmail.com>2022-02-03 18:37:17 +0300
committerClaudio Cambra <claudio.cambra@gmail.com>2022-03-02 15:22:55 +0300
commit655a2e1c3936d4bced3bb7a87b5bbd7ab2ee7a86 (patch)
tree7386851fcb740d8e5d02609cafc2e05a2baaf033 /src/gui
parentbe21f036ff147aa24cabc766ae5c23ea16646fa4 (diff)
No longer assume status bar height, calculate, fixing notch borking
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/systray.cpp5
-rw-r--r--src/gui/systray.h1
-rw-r--r--src/gui/systray.mm5
3 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp
index 707609612..263a91972 100644
--- a/src/gui/systray.cpp
+++ b/src/gui/systray.cpp
@@ -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();
diff --git a/src/gui/systray.h b/src/gui/systray.h
index 31251d01e..6b63d6797 100644
--- a/src/gui/systray.h
+++ b/src/gui/systray.h
@@ -42,6 +42,7 @@ public:
bool canOsXSendUserNotification();
void sendOsXUserNotification(const QString &title, const QString &message);
void setTrayWindowLevelAndVisibleOnAllSpaces(QWindow *window);
+double statusBarThickness();
#endif
/**
diff --git a/src/gui/systray.mm b/src/gui/systray.mm
index a4d35eb23..544455c16 100644
--- a/src/gui/systray.mm
+++ b/src/gui/systray.mm
@@ -17,6 +17,11 @@
namespace OCC {
+double statusBarThickness()
+{
+ return [NSStatusBar systemStatusBar].thickness;
+}
+
bool canOsXSendUserNotification()
{
return NSClassFromString(@"NSUserNotificationCenter") != nil;