Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

workspace: Allow disabling of padding on zoomed panels (#31913)

Cretezy79e74b880baf
diff --git a/assets/settings/default.json b/assets/settings/default.json
index 59450dcc156..f0b9e11e57f 100644
--- a/assets/settings/default.json
+++ b/assets/settings/default.json
@@ -162,6 +162,12 @@
// 2. Always quit the application
// "on_last_window_closed": "quit_app",
"on_last_window_closed": "platform_default",
+ // Whether to show padding for zoomed panels.
+ // When enabled, zoomed center panels (e.g. code editor) will have padding all around,
+ // while zoomed bottom/left/right panels will have padding to the top/right/left (respectively).
+ //
+ // Default: true
+ "zoomed_padding": true,
// Whether to use the system provided dialogs for Open and Save As.
// When set to false, Zed will use the built-in keyboard-first pickers.
"use_system_path_prompts": true,
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index 3654df09bea..0b4694601ed 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -6633,6 +6633,10 @@ impl Render for Workspace {
.inset_0()
.shadow_lg();
+ if !WorkspaceSettings::get_global(cx).zoomed_padding {
+ return Some(div);
+ }
+
Some(match self.zoomed_position {
Some(DockPosition::Left) => div.right_2().border_r_1(),
Some(DockPosition::Right) => div.left_2().border_l_1(),
diff --git a/crates/workspace/src/workspace_settings.rs b/crates/workspace/src/workspace_settings.rs
index 56353475148..3b6bc1ea970 100644
--- a/crates/workspace/src/workspace_settings.rs
+++ b/crates/workspace/src/workspace_settings.rs
@@ -29,6 +29,7 @@ pub struct WorkspaceSettings {
pub on_last_window_closed: OnLastWindowClosed,
pub resize_all_panels_in_dock: Vec<DockPosition>,
pub close_on_file_delete: bool,
+ pub zoomed_padding: bool,
}
#[derive(Copy, Clone, Default, Serialize, Deserialize, JsonSchema)]
@@ -202,6 +203,12 @@ pub struct WorkspaceSettingsContent {
///
/// Default: false
pub close_on_file_delete: Option<bool>,
+ /// Whether to show padding for zoomed panels.
+ /// When enabled, zoomed bottom panels will have some top padding,
+ /// while zoomed left/right panels will have padding to the right/left (respectively).
+ ///
+ /// Default: true
+ pub zoomed_padding: Option<bool>,
}
#[derive(Deserialize)]