Skip to content

Commit f0c7a2f

Browse files
author
Marino Faggiana
committed
menu FIX
Signed-off-by: Marino Faggiana <[email protected]>
1 parent 4be292a commit f0c7a2f

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

Nextcloud.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5547,7 +5547,7 @@
55475547
CLANG_WARN_UNREACHABLE_CODE = YES;
55485548
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
55495549
COPY_PHASE_STRIP = NO;
5550-
CURRENT_PROJECT_VERSION = 0;
5550+
CURRENT_PROJECT_VERSION = 1;
55515551
DEBUG_INFORMATION_FORMAT = dwarf;
55525552
DEVELOPMENT_TEAM = NKUJUXUJ3B;
55535553
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -5613,7 +5613,7 @@
56135613
CLANG_WARN_UNREACHABLE_CODE = YES;
56145614
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
56155615
COPY_PHASE_STRIP = NO;
5616-
CURRENT_PROJECT_VERSION = 0;
5616+
CURRENT_PROJECT_VERSION = 1;
56175617
DEVELOPMENT_TEAM = NKUJUXUJ3B;
56185618
ENABLE_STRICT_OBJC_MSGSEND = YES;
56195619
ENABLE_TESTABILITY = YES;

iOSClient/Menu/NCMenu+FloatingPanel.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,20 @@ class NCMenuFloatingPanelLayout: FloatingPanelLayout {
3636
let topInset: CGFloat
3737

3838
init(actionsHeight: CGFloat) {
39+
guard let windowScene = UIApplication.shared.connectedScenes.first(where: { $0 is UIWindowScene }) as? UIWindowScene,
40+
let window = windowScene.windows.first(where: { $0.isKeyWindow })
41+
else {
42+
topInset = 48
43+
return
44+
}
3945
let screenHeight = UIDevice.current.orientation.isLandscape
40-
? min(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height)
41-
: max(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height)
42-
let window = UIApplication.shared.connectedScenes.flatMap { ($0 as? UIWindowScene)?.windows ?? [] }.first { $0.isKeyWindow }
43-
let bottomInset = window?.rootViewController?.view.safeAreaInsets.bottom ?? 0
44-
let panelHeight = CGFloat(actionsHeight) + bottomInset
46+
? min(window.frame.size.width, window.frame.size.height)
47+
: max(window.frame.size.width, window.frame.size.height)
48+
let bottomInset = window.rootViewController?.view.safeAreaInsets.bottom ?? 0
49+
let panelHeight = actionsHeight + bottomInset
4550

4651
topInset = max(48, screenHeight - panelHeight)
47-
}
52+
}
4853

4954
func prepareLayout(surfaceView: UIView, in view: UIView) -> [NSLayoutConstraint] {
5055
return [

0 commit comments

Comments
 (0)