diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs index 2168b07ffed6f4b546c0fca13ea57f48aa01109f..568356e93825ff51877091d6d77abe81dc8eebb2 100644 --- a/crates/gpui/src/platform/mac/window.rs +++ b/crates/gpui/src/platform/mac/window.rs @@ -129,12 +129,12 @@ unsafe fn build_classes() { window_did_resize as extern "C" fn(&Object, Sel, id), ); decl.add_method( - sel!(windowDidEnterFullScreen:), - window_did_enter_fullscreen as extern "C" fn(&Object, Sel, id), + sel!(windowWillEnterFullScreen:), + window_will_enter_fullscreen as extern "C" fn(&Object, Sel, id), ); decl.add_method( - sel!(windowDidExitFullScreen:), - window_did_exit_fullscreen as extern "C" fn(&Object, Sel, id), + sel!(windowWillExitFullScreen:), + window_will_exit_fullscreen as extern "C" fn(&Object, Sel, id), ); decl.add_method( sel!(windowDidBecomeKey:), @@ -922,11 +922,11 @@ extern "C" fn window_did_resize(this: &Object, _: Sel, _: id) { window_state.as_ref().borrow().move_traffic_light(); } -extern "C" fn window_did_enter_fullscreen(this: &Object, _: Sel, _: id) { +extern "C" fn window_will_enter_fullscreen(this: &Object, _: Sel, _: id) { window_fullscreen_changed(this, true); } -extern "C" fn window_did_exit_fullscreen(this: &Object, _: Sel, _: id) { +extern "C" fn window_will_exit_fullscreen(this: &Object, _: Sel, _: id) { window_fullscreen_changed(this, false); } diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 302ebd65ee227bba2cdb0b675752b69bab1c40ce..a27754aa1308c89ec5823ab703e496d842cf901b 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -1858,6 +1858,17 @@ impl Workspace { worktree_root_names.push_str(name); } + // TODO: There should be a better system in place for this + // (https://github.com/zed-industries/zed/issues/1290) + let is_fullscreen = cx.window_is_fullscreen(cx.window_id()); + let container_theme = if is_fullscreen { + let mut container_theme = theme.workspace.titlebar.container; + container_theme.padding.left = container_theme.padding.right; + container_theme + } else { + theme.workspace.titlebar.container + }; + ConstrainedBox::new( Container::new( Stack::new() @@ -1885,7 +1896,7 @@ impl Workspace { ) .boxed(), ) - .with_style(theme.workspace.titlebar.container) + .with_style(container_theme) .boxed(), ) .with_height(theme.workspace.titlebar.height)