Add ability to hide status bar (#39430)
This pull request adds the ability to configure the setting to hide or show the status bar, as described in discussion: https://github.com/zed-industries/zed/discussions/38591 The original [PR #38974](https://github.com/zed-industries/zed/pull/38974#issuecomment-3362020879) was merged but reverted due to hidden conflicts. As per @ConradIrwin 's [request](https://github.com/zed-industries/zed/pull/38974#issuecomment-3362020879), I am recreating the PR on top of updated main branch. Release Notes: - Added an experimental setting `"status_bar": { "experimental.show": false}` to hide the status bars. --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
co-authored by
Conrad Irwin
parent
55e68553a4
commit
d9c7f44b0b
@@ -222,3 +222,30 @@ impl Settings for TabBarSettings {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct StatusBarSettings {
|
||||
pub show: bool,
|
||||
pub active_language_button: bool,
|
||||
pub cursor_position_button: bool,
|
||||
}
|
||||
|
||||
impl Settings for StatusBarSettings {
|
||||
fn from_settings(content: &settings::SettingsContent, _cx: &mut App) -> Self {
|
||||
let status_bar = content.status_bar.clone().unwrap();
|
||||
StatusBarSettings {
|
||||
show: status_bar.show.unwrap(),
|
||||
active_language_button: status_bar.active_language_button.unwrap(),
|
||||
cursor_position_button: status_bar.cursor_position_button.unwrap(),
|
||||
}
|
||||
}
|
||||
|
||||
fn import_from_vscode(
|
||||
vscode: &settings::VsCodeSettings,
|
||||
current: &mut settings::SettingsContent,
|
||||
) {
|
||||
if let Some(show) = vscode.read_bool("workbench.statusBar.visible") {
|
||||
current.status_bar.get_or_insert_default().show = Some(show);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user