Skip to content

Commit

Permalink
Rename sync_dock_size to sync_panel_size_within_dock
Browse files Browse the repository at this point in the history
Fix some typos in the comments

Signed-off-by: Aaron Ruan <[email protected]>
  • Loading branch information
Aaron-212 committed Oct 12, 2024
1 parent 2d07ca8 commit 1fc0613
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions assets/settings/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
// workspace when the centered layout is used.
"right_padding": 0.2
},
// Whether to sync the sizes of panels a dock. This setting takes in a list of dock positions.
// Whether to sync the sizes of panels within a dock. This setting takes in a list of dock positions.
// Note that this setting cannot sync size between docks.
"sync_dock_size": [],
"sync_panel_size_within_dock": [],
// The key to use for adding multiple cursors
// Currently "alt" or "cmd_or_ctrl" (also aliased as
// "cmd" and "ctrl") are supported.
Expand Down
6 changes: 3 additions & 3 deletions crates/workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4772,7 +4772,7 @@ impl Render for Workspace {
let size = e.event.position.x - workspace.bounds.left();
workspace.left_dock.update(cx, |left_dock, cx| {
if WorkspaceSettings::get_global(cx)
.sync_dock_size
.sync_panel_size_within_dock
.contains(&DockPosition::Left)
{
left_dock.resize_all_panels(Some(size), cx);
Expand All @@ -4785,7 +4785,7 @@ impl Render for Workspace {
let size = workspace.bounds.right() - e.event.position.x;
workspace.right_dock.update(cx, |right_dock, cx| {
if WorkspaceSettings::get_global(cx)
.sync_dock_size
.sync_panel_size_within_dock
.contains(&DockPosition::Right)
{
right_dock.resize_all_panels(Some(size), cx);
Expand All @@ -4798,7 +4798,7 @@ impl Render for Workspace {
let size = workspace.bounds.bottom() - e.event.position.y;
workspace.bottom_dock.update(cx, |bottom_dock, cx| {
if WorkspaceSettings::get_global(cx)
.sync_dock_size
.sync_panel_size_within_dock
.contains(&DockPosition::Bottom)
{
bottom_dock.resize_all_panels(Some(size), cx);
Expand Down
6 changes: 3 additions & 3 deletions crates/workspace/src/workspace_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct WorkspaceSettings {
pub when_closing_with_no_tabs: CloseWindowWhenNoItems,
pub use_system_path_prompts: bool,
pub command_aliases: HashMap<String, String>,
pub sync_dock_size: Vec<DockPosition>,
pub sync_panel_size_within_dock: Vec<DockPosition>,
}

#[derive(Copy, Clone, Default, Serialize, Deserialize, JsonSchema)]
Expand Down Expand Up @@ -114,8 +114,8 @@ pub struct WorkspaceSettingsContent {
/// Whether to sync the sizes of panels in a dock.
/// When a dock position is on the list, resizing one panel will resize all panels in that dock.
///
/// Default: none
pub sync_dock_size: Option<Vec<DockPosition>>,
/// Default: []
pub sync_panel_size_within_dock: Option<Vec<DockPosition>>,
}

#[derive(Deserialize)]
Expand Down

0 comments on commit 1fc0613

Please sign in to comment.