From ef9471687a4b6d1714026ba6dfcb3dcf9f8de6f5 Mon Sep 17 00:00:00 2001 From: Khan Winter <35942988+thecoolwinter@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:07:55 -0600 Subject: [PATCH] Fix Tab Bar being Non-Interactive --- .../Editor/Views/EditorAreaView.swift | 20 +++++++++---------- .../Editor/Views/EditorLayoutView.swift | 5 +++-- CodeEdit/WorkspaceView.swift | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CodeEdit/Features/Editor/Views/EditorAreaView.swift b/CodeEdit/Features/Editor/Views/EditorAreaView.swift index 16b498db5f..3bf1a0e256 100644 --- a/CodeEdit/Features/Editor/Views/EditorAreaView.swift +++ b/CodeEdit/Features/Editor/Views/EditorAreaView.swift @@ -41,11 +41,11 @@ struct EditorAreaView: View { } } - var editorInsetAmount: Double { - let tabBarHeight = shouldShowTabBar ? (EditorTabBarView.height + 1) : 0 - let jumpBarHeight = showEditorJumpBar ? (EditorJumpBarView.height + 1) : 0 - return tabBarHeight + jumpBarHeight - } +// var editorInsetAmount: Double { +// let tabBarHeight = shouldShowTabBar ? (EditorTabBarView.height + 1) : 0 +// let jumpBarHeight = showEditorJumpBar ? (EditorJumpBarView.height + 1) : 0 +// return tabBarHeight + jumpBarHeight +// } VStack { if let selected = editor.selectedTab { @@ -55,9 +55,9 @@ struct EditorAreaView: View { textViewCoordinators: [selected.rangeTranslator].compactMap({ $0 }) ) .focusedObject(editor) - .transformEnvironment(\.edgeInsets) { insets in - insets.top += editorInsetAmount - } +// .transformEnvironment(\.edgeInsets) { insets in +// insets.top += editorInsetAmount +// } .opacity(dimEditorsWithoutFocus && editor != editorManager.activeEditor ? 0.5 : 1) } else { LoadingFileView(selected.file.name) @@ -73,14 +73,14 @@ struct EditorAreaView: View { } else { CEContentUnavailableView("No Editor") - .padding(.top, editorInsetAmount) +// .padding(.top, editorInsetAmount) .onTapGesture { editorManager.activeEditor = editor } } } .frame(maxWidth: .infinity, maxHeight: .infinity) - .ignoresSafeArea(.all) +// .ignoresSafeArea(.all) .safeAreaInset(edge: .top, spacing: 0) { VStack(spacing: 0) { if shouldShowTabBar { diff --git a/CodeEdit/Features/Editor/Views/EditorLayoutView.swift b/CodeEdit/Features/Editor/Views/EditorLayoutView.swift index 2744a65d38..d9d4213ba2 100644 --- a/CodeEdit/Features/Editor/Views/EditorLayoutView.swift +++ b/CodeEdit/Features/Editor/Views/EditorLayoutView.swift @@ -30,10 +30,11 @@ struct EditorLayoutView: View { .transformEnvironment(\.edgeInsets) { insets in switch isAtEdge { case .all: - insets.top += toolbarHeight +// insets.top += toolbarHeight insets.bottom += StatusBarView.height + 5 case .top: - insets.top += toolbarHeight +// insets.top += toolbarHeight + break case .bottom: insets.bottom += StatusBarView.height + 5 default: diff --git a/CodeEdit/WorkspaceView.swift b/CodeEdit/WorkspaceView.swift index 3a7cf0ddff..cebc98db0f 100644 --- a/CodeEdit/WorkspaceView.swift +++ b/CodeEdit/WorkspaceView.swift @@ -84,7 +84,7 @@ struct WorkspaceView: View { } .accessibilityHidden(true) } - .edgesIgnoringSafeArea(.top) +// .ignoresSafeArea(edges: .top) .frame(maxWidth: .infinity, maxHeight: .infinity) .overlay(alignment: .top) { ZStack(alignment: .top) {