From 0369737fcb5a9299cfd876bb165ead25a7037a3f Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 23 Sep 2025 22:15:30 -0600 Subject: [PATCH] Revert "Add setting to show/hide title bar (#37428)" (#38756) Closes https://github.com/zed-industries/zed/issues/38547 Release Notes: - Reverted the ability to show/hide the titlebar. This caused rendering bugs on macOS, and we're preparing for the redesign which requires the toolbar being present. --------- Co-authored-by: Kirill Bulatov --- assets/settings/default.json | 2 - crates/settings/src/settings_content.rs | 0 crates/title_bar/src/title_bar.rs | 49 ++-------------------- crates/title_bar/src/title_bar_settings.rs | 13 ------ crates/workspace/src/workspace.rs | 5 --- docs/src/configuring-zed.md | 1 - docs/src/visual-customization.md | 1 - 7 files changed, 4 insertions(+), 67 deletions(-) create mode 100644 crates/settings/src/settings_content.rs diff --git a/assets/settings/default.json b/assets/settings/default.json index daab56dc93976728667ed6995cb445f363ee2be8..1f0035d2097b62223d57be308eab7d1903c9e072 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -391,8 +391,6 @@ "use_system_window_tabs": false, // Titlebar related settings "title_bar": { - // When to show the title bar: "always" | "never" | "hide_in_full_screen". - "show": "always", // Whether to show the branch icon beside branch switcher in the titlebar. "show_branch_icon": false, // Whether to show the branch name button in the titlebar. diff --git a/crates/settings/src/settings_content.rs b/crates/settings/src/settings_content.rs new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/crates/title_bar/src/title_bar.rs b/crates/title_bar/src/title_bar.rs index 9f00b0ffeffe6b9744ffa67a0f52795e31e5737f..1a1ecdcd788bf53815021beb4fa449c753df28e5 100644 --- a/crates/title_bar/src/title_bar.rs +++ b/crates/title_bar/src/title_bar.rs @@ -4,7 +4,7 @@ mod onboarding_banner; pub mod platform_title_bar; mod platforms; mod system_window_tabs; -pub mod title_bar_settings; +mod title_bar_settings; #[cfg(feature = "stories")] mod stories; @@ -35,7 +35,7 @@ use remote::RemoteConnectionOptions; use settings::{Settings, SettingsLocation}; use std::{path::Path, sync::Arc}; use theme::ActiveTheme; -use title_bar_settings::{TitleBarSettings, TitleBarVisibility}; +use title_bar_settings::TitleBarSettings; use ui::{ Avatar, Button, ButtonLike, ButtonStyle, Chip, ContextMenu, Icon, IconName, IconSize, IconWithIndicator, Indicator, PopoverMenu, PopoverMenuHandle, Tooltip, h_flex, prelude::*, @@ -73,49 +73,8 @@ pub fn init(cx: &mut App) { let Some(window) = window else { return; }; - let should_show = match TitleBarSettings::get_global(cx).show { - TitleBarVisibility::Always => true, - TitleBarVisibility::Never => false, - TitleBarVisibility::HideInFullScreen => !window.is_fullscreen(), - }; - if should_show { - let item = cx.new(|cx| TitleBar::new("title-bar", workspace, window, cx)); - workspace.set_titlebar_item(item.into(), window, cx); - } - - cx.observe_global_in::(window, |workspace, window, cx| { - let should_show = match TitleBarSettings::get_global(cx).show { - TitleBarVisibility::Always => true, - TitleBarVisibility::Never => false, - TitleBarVisibility::HideInFullScreen => !window.is_fullscreen(), - }; - if should_show { - if workspace.titlebar_item().is_none() { - let item = cx.new(|cx| TitleBar::new("title-bar", workspace, window, cx)); - workspace.set_titlebar_item(item.into(), window, cx); - } - } else { - workspace.clear_titlebar_item(window, cx); - } - }) - .detach(); - - cx.observe_window_bounds(window, |workspace, window, cx| { - let should_show = match TitleBarSettings::get_global(cx).show { - TitleBarVisibility::Always => true, - TitleBarVisibility::Never => false, - TitleBarVisibility::HideInFullScreen => !window.is_fullscreen(), - }; - if should_show { - if workspace.titlebar_item().is_none() { - let item = cx.new(|cx| TitleBar::new("title-bar", workspace, window, cx)); - workspace.set_titlebar_item(item.into(), window, cx); - } - } else { - workspace.clear_titlebar_item(window, cx); - } - }) - .detach(); + let item = cx.new(|cx| TitleBar::new("title-bar", workspace, window, cx)); + workspace.set_titlebar_item(item.into(), window, cx); #[cfg(not(target_os = "macos"))] workspace.register_action(|workspace, action: &OpenApplicationMenu, window, cx| { diff --git a/crates/title_bar/src/title_bar_settings.rs b/crates/title_bar/src/title_bar_settings.rs index 240c1fd74f0b6f49feef09ce20a81e5f54adfcb1..38e529098bd3e97a11ecefac684c1734302f4261 100644 --- a/crates/title_bar/src/title_bar_settings.rs +++ b/crates/title_bar/src/title_bar_settings.rs @@ -3,17 +3,8 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use settings::{Settings, SettingsKey, SettingsSources, SettingsUi}; -#[derive(Copy, Clone, Serialize, Deserialize, JsonSchema, Debug, SettingsUi)] -#[serde(rename_all = "snake_case")] -pub enum TitleBarVisibility { - Always, - Never, - HideInFullScreen, -} - #[derive(Copy, Clone, Deserialize, Debug)] pub struct TitleBarSettings { - pub show: TitleBarVisibility, pub show_branch_icon: bool, pub show_onboarding_banner: bool, pub show_user_picture: bool, @@ -29,10 +20,6 @@ pub struct TitleBarSettings { #[settings_ui(group = "Title Bar")] #[settings_key(key = "title_bar")] pub struct TitleBarSettingsContent { - /// Controls when the title bar is visible: "always" | "never" | "hide_in_full_screen". - /// - /// Default: "always" - pub show: Option, /// Whether to show the branch icon beside branch switcher in the title bar. /// /// Default: false diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 5772695310e1258bee2a62953ad4bcc3620cd4ee..a628ee175fb452d9b8502446eaf7b4c440b863c8 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -2043,11 +2043,6 @@ impl Workspace { cx.notify(); } - pub fn clear_titlebar_item(&mut self, _: &mut Window, cx: &mut Context) { - self.titlebar_item = None; - cx.notify(); - } - pub fn set_prompt_for_new_path(&mut self, prompt: PromptForNewPath) { self.on_prompt_for_new_path = Some(prompt) } diff --git a/docs/src/configuring-zed.md b/docs/src/configuring-zed.md index 6c25d62e291f91f3faf4dc77e5a6dab3b8637ca8..2524022b034b42de1bbe5775419998e92caa090e 100644 --- a/docs/src/configuring-zed.md +++ b/docs/src/configuring-zed.md @@ -4125,7 +4125,6 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a ```json "title_bar": { - "show": "always", "show_branch_icon": false, "show_branch_name": true, "show_project_items": true, diff --git a/docs/src/visual-customization.md b/docs/src/visual-customization.md index 150b701168f49980844ea37c223efe00b6dc06cc..27802888c90b29d7998d47c1668c4015d307476d 100644 --- a/docs/src/visual-customization.md +++ b/docs/src/visual-customization.md @@ -108,7 +108,6 @@ To disable this behavior use: ```json // Control which items are shown/hidden in the title bar "title_bar": { - "show": "always", // When to show: always | never | hide_in_full_screen "show_branch_icon": false, // Show/hide branch icon beside branch switcher "show_branch_name": true, // Show/hide branch name "show_project_items": true, // Show/hide project host and name