Skip to content

Commit

Permalink
menu FIX
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana committed Jan 17, 2025
1 parent 4be292a commit f0c7a2f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5547,7 +5547,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = NKUJUXUJ3B;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -5613,7 +5613,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = NKUJUXUJ3B;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down
17 changes: 11 additions & 6 deletions iOSClient/Menu/NCMenu+FloatingPanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ class NCMenuFloatingPanelLayout: FloatingPanelLayout {
let topInset: CGFloat

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

topInset = max(48, screenHeight - panelHeight)
}
}

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

0 comments on commit f0c7a2f

Please sign in to comment.