Fix minimal mode tab bar disappearing in fullscreen (#2375)
Three issues caused the Bonsplit horizontal tab bar to be hidden when entering fullscreen with minimal mode enabled: 1. ignoresSafeArea(.container, edges: .top) was applied unconditionally in minimal mode, pushing content behind the fullscreen menu bar area. Now gated on !isFullScreen. 2. effectiveTitlebarPadding returned -titlebarPadding in minimal mode regardless of fullscreen state. In fullscreen there is no native titlebar to compensate for, so the negative offset pushed content off the top of the screen. Now returns 0 in fullscreen. 3. Traffic light leading inset (80px) was applied in fullscreen minimal mode even though there are no traffic light buttons. Now gated on !isFullScreen, and syncTrafficLightInset is called on fullscreen enter/exit. Closes https://github.com/manaflow-ai/cmux/issues/2317 Based on https://github.com/manaflow-ai/cmux/pull/2341 Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
This commit is contained in:
parent
c2abfb9760
commit
d015ace094
2 changed files with 10 additions and 3 deletions
|
|
@ -2348,7 +2348,10 @@ struct ContentView: View {
|
|||
}
|
||||
|
||||
private var effectiveTitlebarPadding: CGFloat {
|
||||
isMinimalMode ? -titlebarPadding : titlebarPadding
|
||||
if isMinimalMode {
|
||||
return isFullScreen ? 0 : -titlebarPadding
|
||||
}
|
||||
return titlebarPadding
|
||||
}
|
||||
|
||||
private var terminalContent: some View {
|
||||
|
|
@ -2378,6 +2381,7 @@ struct ContentView: View {
|
|||
workspace: tab,
|
||||
isWorkspaceVisible: presentation.isPanelVisible,
|
||||
isWorkspaceInputActive: isInputActive,
|
||||
isFullScreen: isFullScreen,
|
||||
workspacePortalPriority: portalPriority,
|
||||
onThemeRefreshRequest: { reason, eventId, source, payloadHex in
|
||||
scheduleTitlebarThemeRefreshFromWorkspace(
|
||||
|
|
@ -2514,7 +2518,7 @@ struct ContentView: View {
|
|||
}
|
||||
|
||||
private func syncTrafficLightInset() {
|
||||
let inset: CGFloat = (isMinimalMode && !sidebarState.isVisible) ? 80 : 0
|
||||
let inset: CGFloat = (isMinimalMode && !sidebarState.isVisible && !isFullScreen) ? 80 : 0
|
||||
for tab in tabManager.tabs {
|
||||
if tab.bonsplitController.configuration.appearance.tabBarLeadingInset != inset {
|
||||
tab.bonsplitController.configuration.appearance.tabBarLeadingInset = inset
|
||||
|
|
@ -3051,6 +3055,7 @@ struct ContentView: View {
|
|||
isFullScreen = true
|
||||
setTitlebarControlsHidden(true, in: window)
|
||||
AppDelegate.shared?.fullscreenControlsViewModel = fullscreenControlsViewModel
|
||||
syncTrafficLightInset()
|
||||
})
|
||||
|
||||
view = AnyView(view.onReceive(NotificationCenter.default.publisher(for: NSWindow.didExitFullScreenNotification)) { notification in
|
||||
|
|
@ -3059,6 +3064,7 @@ struct ContentView: View {
|
|||
isFullScreen = false
|
||||
setTitlebarControlsHidden(false, in: window)
|
||||
AppDelegate.shared?.fullscreenControlsViewModel = nil
|
||||
syncTrafficLightInset()
|
||||
})
|
||||
|
||||
view = AnyView(view.onReceive(NotificationCenter.default.publisher(for: NSWindow.didResizeNotification)) { notification in
|
||||
|
|
|
|||
|
|
@ -225,6 +225,7 @@ struct WorkspaceContentView: View {
|
|||
@ObservedObject var workspace: Workspace
|
||||
let isWorkspaceVisible: Bool
|
||||
let isWorkspaceInputActive: Bool
|
||||
let isFullScreen: Bool
|
||||
let workspacePortalPriority: Int
|
||||
let onThemeRefreshRequest: ((
|
||||
_ reason: String,
|
||||
|
|
@ -377,7 +378,7 @@ struct WorkspaceContentView: View {
|
|||
}
|
||||
|
||||
Group {
|
||||
if isMinimalMode {
|
||||
if isMinimalMode && !isFullScreen {
|
||||
bonsplitView
|
||||
.ignoresSafeArea(.container, edges: .top)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue