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 <kirill@zed.dev>
This commit is contained in:
co-authored by
Kirill Bulatov
parent
0f7dbf57f5
commit
5d89b2ea26
@@ -391,8 +391,6 @@
|
|||||||
"use_system_window_tabs": false,
|
"use_system_window_tabs": false,
|
||||||
// Titlebar related settings
|
// Titlebar related settings
|
||||||
"title_bar": {
|
"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.
|
// Whether to show the branch icon beside branch switcher in the titlebar.
|
||||||
"show_branch_icon": false,
|
"show_branch_icon": false,
|
||||||
// Whether to show the branch name button in the titlebar.
|
// Whether to show the branch name button in the titlebar.
|
||||||
|
|||||||
@@ -237,10 +237,6 @@ pub enum BaseKeymapContent {
|
|||||||
#[skip_serializing_none]
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug)]
|
#[derive(Clone, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug)]
|
||||||
pub struct TitleBarSettingsContent {
|
pub struct TitleBarSettingsContent {
|
||||||
/// Controls when the title bar is visible: "always" | "never" | "hide_in_full_screen".
|
|
||||||
///
|
|
||||||
/// Default: "always"
|
|
||||||
pub show: Option<TitleBarVisibility>,
|
|
||||||
/// Whether to show the branch icon beside branch switcher in the title bar.
|
/// Whether to show the branch icon beside branch switcher in the title bar.
|
||||||
///
|
///
|
||||||
/// Default: false
|
/// Default: false
|
||||||
@@ -271,14 +267,6 @@ pub struct TitleBarSettingsContent {
|
|||||||
pub show_menus: Option<bool>,
|
pub show_menus: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, JsonSchema, MergeFrom, Debug)]
|
|
||||||
#[serde(rename_all = "snake_case")]
|
|
||||||
pub enum TitleBarVisibility {
|
|
||||||
Always,
|
|
||||||
Never,
|
|
||||||
HideInFullScreen,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Configuration of audio in Zed.
|
/// Configuration of audio in Zed.
|
||||||
#[skip_serializing_none]
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug)]
|
#[derive(Clone, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug)]
|
||||||
|
|||||||
@@ -1022,7 +1022,7 @@ mod tests {
|
|||||||
use std::num::NonZeroU32;
|
use std::num::NonZeroU32;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
TitleBarSettingsContent, TitleBarVisibility, VsCodeSettingsSource, default_settings,
|
ClosePosition, ItemSettingsContent, VsCodeSettingsSource, default_settings,
|
||||||
settings_content::LanguageSettingsContent, test_settings,
|
settings_content::LanguageSettingsContent, test_settings,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1043,30 +1043,30 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
struct TitleBarSettings {
|
struct ItemSettings {
|
||||||
show: TitleBarVisibility,
|
close_position: ClosePosition,
|
||||||
show_branch_name: bool,
|
git_status: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Settings for TitleBarSettings {
|
impl Settings for ItemSettings {
|
||||||
fn from_settings(content: &SettingsContent, _: &mut App) -> Self {
|
fn from_settings(content: &SettingsContent, _: &mut App) -> Self {
|
||||||
let content = content.title_bar.clone().unwrap();
|
let content = content.tabs.clone().unwrap();
|
||||||
TitleBarSettings {
|
ItemSettings {
|
||||||
show: content.show.unwrap(),
|
close_position: content.close_position.unwrap(),
|
||||||
show_branch_name: content.show_branch_name.unwrap(),
|
git_status: content.git_status.unwrap(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn import_from_vscode(vscode: &VsCodeSettings, content: &mut SettingsContent) {
|
fn import_from_vscode(vscode: &VsCodeSettings, content: &mut SettingsContent) {
|
||||||
let mut show = None;
|
let mut show = None;
|
||||||
|
|
||||||
vscode.enum_setting("window.titleBarStyle", &mut show, |value| match value {
|
vscode.bool_setting("workbench.editor.decorations.colors", &mut show);
|
||||||
"never" => Some(TitleBarVisibility::Never),
|
|
||||||
"always" => Some(TitleBarVisibility::Always),
|
|
||||||
_ => None,
|
|
||||||
});
|
|
||||||
if let Some(show) = show {
|
if let Some(show) = show {
|
||||||
content.title_bar.get_or_insert_default().show.replace(show);
|
content
|
||||||
|
.tabs
|
||||||
|
.get_or_insert_default()
|
||||||
|
.git_status
|
||||||
|
.replace(show);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1103,7 +1103,7 @@ mod tests {
|
|||||||
fn test_settings_store_basic(cx: &mut App) {
|
fn test_settings_store_basic(cx: &mut App) {
|
||||||
let mut store = SettingsStore::new(cx, &default_settings());
|
let mut store = SettingsStore::new(cx, &default_settings());
|
||||||
store.register_setting::<AutoUpdateSetting>(cx);
|
store.register_setting::<AutoUpdateSetting>(cx);
|
||||||
store.register_setting::<TitleBarSettings>(cx);
|
store.register_setting::<ItemSettings>(cx);
|
||||||
store.register_setting::<DefaultLanguageSettings>(cx);
|
store.register_setting::<DefaultLanguageSettings>(cx);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@@ -1111,16 +1111,16 @@ mod tests {
|
|||||||
&AutoUpdateSetting { auto_update: true }
|
&AutoUpdateSetting { auto_update: true }
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
store.get::<TitleBarSettings>(None).show,
|
store.get::<ItemSettings>(None).close_position,
|
||||||
TitleBarVisibility::Always
|
ClosePosition::Right
|
||||||
);
|
);
|
||||||
|
|
||||||
store
|
store
|
||||||
.set_user_settings(
|
.set_user_settings(
|
||||||
r#"{
|
r#"{
|
||||||
"auto_update": false,
|
"auto_update": false,
|
||||||
"title_bar": {
|
"tabs": {
|
||||||
"show": "never"
|
"close_position": "left"
|
||||||
}
|
}
|
||||||
}"#,
|
}"#,
|
||||||
cx,
|
cx,
|
||||||
@@ -1132,8 +1132,8 @@ mod tests {
|
|||||||
&AutoUpdateSetting { auto_update: false }
|
&AutoUpdateSetting { auto_update: false }
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
store.get::<TitleBarSettings>(None).show,
|
store.get::<ItemSettings>(None).close_position,
|
||||||
TitleBarVisibility::Never
|
ClosePosition::Left
|
||||||
);
|
);
|
||||||
|
|
||||||
store
|
store
|
||||||
@@ -1160,7 +1160,7 @@ mod tests {
|
|||||||
WorktreeId::from_usize(1),
|
WorktreeId::from_usize(1),
|
||||||
Path::new("/root2").into(),
|
Path::new("/root2").into(),
|
||||||
LocalSettingsKind::Settings,
|
LocalSettingsKind::Settings,
|
||||||
Some(r#"{ "tab_size": 9, "title_bar": { "show_branch_name": false } }"#),
|
Some(r#"{ "tab_size": 9, "auto_update": true}"#),
|
||||||
cx,
|
cx,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@@ -1196,14 +1196,11 @@ mod tests {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
store.get::<TitleBarSettings>(Some(SettingsLocation {
|
store.get::<AutoUpdateSetting>(Some(SettingsLocation {
|
||||||
worktree_id: WorktreeId::from_usize(1),
|
worktree_id: WorktreeId::from_usize(1),
|
||||||
path: Path::new("/root2/something")
|
path: Path::new("/root2/something")
|
||||||
})),
|
})),
|
||||||
&TitleBarSettings {
|
&AutoUpdateSetting { auto_update: false }
|
||||||
show: TitleBarVisibility::Never,
|
|
||||||
show_branch_name: true,
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1214,16 +1211,11 @@ mod tests {
|
|||||||
.set_user_settings(r#"{ "auto_update": false }"#, cx)
|
.set_user_settings(r#"{ "auto_update": false }"#, cx)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
store.register_setting::<AutoUpdateSetting>(cx);
|
store.register_setting::<AutoUpdateSetting>(cx);
|
||||||
store.register_setting::<TitleBarSettings>(cx);
|
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
store.get::<AutoUpdateSetting>(None),
|
store.get::<AutoUpdateSetting>(None),
|
||||||
&AutoUpdateSetting { auto_update: false }
|
&AutoUpdateSetting { auto_update: false }
|
||||||
);
|
);
|
||||||
assert_eq!(
|
|
||||||
store.get::<TitleBarSettings>(None).show,
|
|
||||||
TitleBarVisibility::Always,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
@@ -1346,14 +1338,14 @@ mod tests {
|
|||||||
check_settings_update(
|
check_settings_update(
|
||||||
&mut store,
|
&mut store,
|
||||||
r#"{
|
r#"{
|
||||||
"title_bar": { "show": "always", "name": "Max" }
|
"tabs": { "close_position": "left", "name": "Max" }
|
||||||
}"#
|
}"#
|
||||||
.unindent(),
|
.unindent(),
|
||||||
|settings| {
|
|settings| {
|
||||||
settings.title_bar.as_mut().unwrap().show = Some(TitleBarVisibility::Never);
|
settings.tabs.as_mut().unwrap().close_position = Some(ClosePosition::Left);
|
||||||
},
|
},
|
||||||
r#"{
|
r#"{
|
||||||
"title_bar": { "show": "never", "name": "Max" }
|
"tabs": { "close_position": "left", "name": "Max" }
|
||||||
}"#
|
}"#
|
||||||
.unindent(),
|
.unindent(),
|
||||||
cx,
|
cx,
|
||||||
@@ -1372,13 +1364,13 @@ mod tests {
|
|||||||
check_settings_update(
|
check_settings_update(
|
||||||
&mut store,
|
&mut store,
|
||||||
r#"{
|
r#"{
|
||||||
"title_bar": {}
|
"tabs": {}
|
||||||
}"#
|
}"#
|
||||||
.unindent(),
|
.unindent(),
|
||||||
|settings| settings.title_bar.as_mut().unwrap().show_menus = Some(true),
|
|settings| settings.tabs.as_mut().unwrap().close_position = Some(ClosePosition::Left),
|
||||||
r#"{
|
r#"{
|
||||||
"title_bar": {
|
"tabs": {
|
||||||
"show_menus": true
|
"close_position": "left"
|
||||||
}
|
}
|
||||||
}"#
|
}"#
|
||||||
.unindent(),
|
.unindent(),
|
||||||
@@ -1390,14 +1382,14 @@ mod tests {
|
|||||||
&mut store,
|
&mut store,
|
||||||
r#""#.unindent(),
|
r#""#.unindent(),
|
||||||
|settings| {
|
|settings| {
|
||||||
settings.title_bar = Some(TitleBarSettingsContent {
|
settings.tabs = Some(ItemSettingsContent {
|
||||||
show_branch_name: Some(true),
|
git_status: Some(true),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
r#"{
|
r#"{
|
||||||
"title_bar": {
|
"tabs": {
|
||||||
"show_branch_name": true
|
"git_status": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"#
|
"#
|
||||||
@@ -1427,7 +1419,7 @@ mod tests {
|
|||||||
fn test_vscode_import(cx: &mut App) {
|
fn test_vscode_import(cx: &mut App) {
|
||||||
let mut store = SettingsStore::new(cx, &test_settings());
|
let mut store = SettingsStore::new(cx, &test_settings());
|
||||||
store.register_setting::<DefaultLanguageSettings>(cx);
|
store.register_setting::<DefaultLanguageSettings>(cx);
|
||||||
store.register_setting::<TitleBarSettings>(cx);
|
store.register_setting::<ItemSettings>(cx);
|
||||||
store.register_setting::<AutoUpdateSetting>(cx);
|
store.register_setting::<AutoUpdateSetting>(cx);
|
||||||
|
|
||||||
// create settings that werent present
|
// create settings that werent present
|
||||||
@@ -1487,16 +1479,13 @@ mod tests {
|
|||||||
check_vscode_import(
|
check_vscode_import(
|
||||||
&mut store,
|
&mut store,
|
||||||
r#"{
|
r#"{
|
||||||
"title_bar": {
|
|
||||||
"show": "always"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
"#
|
"#
|
||||||
.unindent(),
|
.unindent(),
|
||||||
r#"{ "window.titleBarStyle": "never" }"#.to_owned(),
|
r#"{ "workbench.editor.decorations.colors": true }"#.to_owned(),
|
||||||
r#"{
|
r#"{
|
||||||
"title_bar": {
|
"tabs": {
|
||||||
"show": "never"
|
"git_status": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"#
|
"#
|
||||||
@@ -1550,14 +1539,15 @@ mod tests {
|
|||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
fn test_global_settings(cx: &mut App) {
|
fn test_global_settings(cx: &mut App) {
|
||||||
let mut store = SettingsStore::new(cx, &test_settings());
|
let mut store = SettingsStore::new(cx, &test_settings());
|
||||||
store.register_setting::<TitleBarSettings>(cx);
|
store.register_setting::<ItemSettings>(cx);
|
||||||
|
|
||||||
// Set global settings - these should override defaults but not user settings
|
// Set global settings - these should override defaults but not user settings
|
||||||
store
|
store
|
||||||
.set_global_settings(
|
.set_global_settings(
|
||||||
r#"{
|
r#"{
|
||||||
"title_bar": {
|
"tabs": {
|
||||||
"show": "never",
|
"close_position": "right",
|
||||||
|
"git_status": true,
|
||||||
}
|
}
|
||||||
}"#,
|
}"#,
|
||||||
cx,
|
cx,
|
||||||
@@ -1566,10 +1556,10 @@ mod tests {
|
|||||||
|
|
||||||
// Before user settings, global settings should apply
|
// Before user settings, global settings should apply
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
store.get::<TitleBarSettings>(None),
|
store.get::<ItemSettings>(None),
|
||||||
&TitleBarSettings {
|
&ItemSettings {
|
||||||
show: TitleBarVisibility::Never,
|
close_position: ClosePosition::Right,
|
||||||
show_branch_name: true,
|
git_status: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1577,8 +1567,8 @@ mod tests {
|
|||||||
store
|
store
|
||||||
.set_user_settings(
|
.set_user_settings(
|
||||||
r#"{
|
r#"{
|
||||||
"title_bar": {
|
"tabs": {
|
||||||
"show": "always"
|
"close_position": "left"
|
||||||
}
|
}
|
||||||
}"#,
|
}"#,
|
||||||
cx,
|
cx,
|
||||||
@@ -1587,10 +1577,10 @@ mod tests {
|
|||||||
|
|
||||||
// User settings should override global settings
|
// User settings should override global settings
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
store.get::<TitleBarSettings>(None),
|
store.get::<ItemSettings>(None),
|
||||||
&TitleBarSettings {
|
&ItemSettings {
|
||||||
show: TitleBarVisibility::Always,
|
close_position: ClosePosition::Left,
|
||||||
show_branch_name: true, // Staff from global settings
|
git_status: true, // Staff from global settings
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ mod onboarding_banner;
|
|||||||
pub mod platform_title_bar;
|
pub mod platform_title_bar;
|
||||||
mod platforms;
|
mod platforms;
|
||||||
mod system_window_tabs;
|
mod system_window_tabs;
|
||||||
pub mod title_bar_settings;
|
mod title_bar_settings;
|
||||||
|
|
||||||
#[cfg(feature = "stories")]
|
#[cfg(feature = "stories")]
|
||||||
mod stories;
|
mod stories;
|
||||||
@@ -35,7 +35,7 @@ use remote::RemoteConnectionOptions;
|
|||||||
use settings::{Settings, SettingsLocation};
|
use settings::{Settings, SettingsLocation};
|
||||||
use std::{path::Path, sync::Arc};
|
use std::{path::Path, sync::Arc};
|
||||||
use theme::ActiveTheme;
|
use theme::ActiveTheme;
|
||||||
use title_bar_settings::{TitleBarSettings, TitleBarVisibility};
|
use title_bar_settings::TitleBarSettings;
|
||||||
use ui::{
|
use ui::{
|
||||||
Avatar, Button, ButtonLike, ButtonStyle, Chip, ContextMenu, Icon, IconName, IconSize,
|
Avatar, Button, ButtonLike, ButtonStyle, Chip, ContextMenu, Icon, IconName, IconSize,
|
||||||
IconWithIndicator, Indicator, PopoverMenu, PopoverMenuHandle, Tooltip, h_flex, prelude::*,
|
IconWithIndicator, Indicator, PopoverMenu, PopoverMenuHandle, Tooltip, h_flex, prelude::*,
|
||||||
@@ -73,49 +73,8 @@ pub fn init(cx: &mut App) {
|
|||||||
let Some(window) = window else {
|
let Some(window) = window else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
let should_show = match TitleBarSettings::get_global(cx).show {
|
let item = cx.new(|cx| TitleBar::new("title-bar", workspace, window, cx));
|
||||||
TitleBarVisibility::Always => true,
|
workspace.set_titlebar_item(item.into(), window, cx);
|
||||||
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::<settings::SettingsStore>(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();
|
|
||||||
|
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
workspace.register_action(|workspace, action: &OpenApplicationMenu, window, cx| {
|
workspace.register_action(|workspace, action: &OpenApplicationMenu, window, cx| {
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
pub use settings::TitleBarVisibility;
|
|
||||||
use settings::{Settings, SettingsContent};
|
use settings::{Settings, SettingsContent};
|
||||||
use ui::App;
|
use ui::App;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct TitleBarSettings {
|
pub struct TitleBarSettings {
|
||||||
pub show: TitleBarVisibility,
|
|
||||||
pub show_branch_icon: bool,
|
pub show_branch_icon: bool,
|
||||||
pub show_onboarding_banner: bool,
|
pub show_onboarding_banner: bool,
|
||||||
pub show_user_picture: bool,
|
pub show_user_picture: bool,
|
||||||
@@ -18,7 +16,6 @@ impl Settings for TitleBarSettings {
|
|||||||
fn from_settings(s: &SettingsContent, _: &mut App) -> Self {
|
fn from_settings(s: &SettingsContent, _: &mut App) -> Self {
|
||||||
let content = s.title_bar.clone().unwrap();
|
let content = s.title_bar.clone().unwrap();
|
||||||
TitleBarSettings {
|
TitleBarSettings {
|
||||||
show: content.show.unwrap(),
|
|
||||||
show_branch_icon: content.show_branch_icon.unwrap(),
|
show_branch_icon: content.show_branch_icon.unwrap(),
|
||||||
show_onboarding_banner: content.show_onboarding_banner.unwrap(),
|
show_onboarding_banner: content.show_onboarding_banner.unwrap(),
|
||||||
show_user_picture: content.show_user_picture.unwrap(),
|
show_user_picture: content.show_user_picture.unwrap(),
|
||||||
|
|||||||
@@ -2040,11 +2040,6 @@ impl Workspace {
|
|||||||
cx.notify();
|
cx.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clear_titlebar_item(&mut self, _: &mut Window, cx: &mut Context<Self>) {
|
|
||||||
self.titlebar_item = None;
|
|
||||||
cx.notify();
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_prompt_for_new_path(&mut self, prompt: PromptForNewPath) {
|
pub fn set_prompt_for_new_path(&mut self, prompt: PromptForNewPath) {
|
||||||
self.on_prompt_for_new_path = Some(prompt)
|
self.on_prompt_for_new_path = Some(prompt)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4140,7 +4140,6 @@ Run the {#action theme_selector::Toggle} action in the command palette to see a
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
"title_bar": {
|
"title_bar": {
|
||||||
"show": "always",
|
|
||||||
"show_branch_icon": false,
|
"show_branch_icon": false,
|
||||||
"show_branch_name": true,
|
"show_branch_name": true,
|
||||||
"show_project_items": true,
|
"show_project_items": true,
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ To disable this behavior use:
|
|||||||
```json
|
```json
|
||||||
// Control which items are shown/hidden in the title bar
|
// Control which items are shown/hidden in the title bar
|
||||||
"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_icon": false, // Show/hide branch icon beside branch switcher
|
||||||
"show_branch_name": true, // Show/hide branch name
|
"show_branch_name": true, // Show/hide branch name
|
||||||
"show_project_items": true, // Show/hide project host and name
|
"show_project_items": true, // Show/hide project host and name
|
||||||
|
|||||||
Reference in New Issue
Block a user