settings: Remove auxiliary Content types where possible (#16744)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-09-10 22:59:10 -04:00 committed by GitHub
parent 8f28445612
commit ccf6f27b8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 843 additions and 696 deletions

View file

@ -2289,7 +2289,7 @@ impl ProjectPanel {
.child(
ListItem::new(entry_id.to_proto() as usize)
.indent_level(depth)
.indent_step_size(px(settings.indent_size))
.indent_step_size(settings.indent_size)
.selected(is_marked || is_active)
.when_some(canonical_path, |this, path| {
this.end_slot::<AnyElement>(
@ -2817,7 +2817,7 @@ impl Render for DraggedProjectEntryView {
this.bg(cx.theme().colors().background).w(self.width).child(
ListItem::new(self.selection.entry_id.to_proto() as usize)
.indent_level(self.details.depth)
.indent_step_size(px(settings.indent_size))
.indent_step_size(settings.indent_size)
.child(if let Some(icon) = &self.details.icon {
div().child(Icon::from_path(icon.clone()))
} else {
@ -2855,7 +2855,7 @@ impl Panel for ProjectPanel {
DockPosition::Left | DockPosition::Bottom => ProjectPanelDockPosition::Left,
DockPosition::Right => ProjectPanelDockPosition::Right,
};
settings.dock = Some(dock);
settings.dock = dock;
},
);
}
@ -3029,7 +3029,7 @@ mod tests {
cx.update_global::<SettingsStore, _>(|store, cx| {
store.update_user_settings::<WorktreeSettings>(cx, |worktree_settings| {
worktree_settings.file_scan_exclusions =
Some(vec!["**/.git".to_string(), "**/4/**".to_string()]);
vec!["**/.git".to_string(), "**/4/**".to_string()];
});
});
});
@ -4818,10 +4818,10 @@ mod tests {
cx.update(|cx| {
cx.update_global::<SettingsStore, _>(|store, cx| {
store.update_user_settings::<WorktreeSettings>(cx, |worktree_settings| {
worktree_settings.file_scan_exclusions = Some(Vec::new());
worktree_settings.file_scan_exclusions = Vec::new();
});
store.update_user_settings::<ProjectPanelSettings>(cx, |project_panel_settings| {
project_panel_settings.auto_reveal_entries = Some(false)
project_panel_settings.auto_reveal_entries = false
});
})
});
@ -4940,7 +4940,7 @@ mod tests {
cx.update(|cx| {
cx.update_global::<SettingsStore, _>(|store, cx| {
store.update_user_settings::<ProjectPanelSettings>(cx, |project_panel_settings| {
project_panel_settings.auto_reveal_entries = Some(true)
project_panel_settings.auto_reveal_entries = true
});
})
});
@ -5054,10 +5054,10 @@ mod tests {
cx.update(|cx| {
cx.update_global::<SettingsStore, _>(|store, cx| {
store.update_user_settings::<WorktreeSettings>(cx, |worktree_settings| {
worktree_settings.file_scan_exclusions = Some(Vec::new());
worktree_settings.file_scan_exclusions = Vec::new();
});
store.update_user_settings::<ProjectPanelSettings>(cx, |project_panel_settings| {
project_panel_settings.auto_reveal_entries = Some(false)
project_panel_settings.auto_reveal_entries = false
});
})
});
@ -5256,7 +5256,7 @@ mod tests {
cx.update_global::<SettingsStore, _>(|store, cx| {
store.update_user_settings::<WorktreeSettings>(cx, |project_settings| {
project_settings.file_scan_exclusions =
Some(vec!["excluded_dir".to_string(), "**/.git".to_string()]);
vec!["excluded_dir".to_string(), "**/.git".to_string()];
});
});
});
@ -5569,10 +5569,10 @@ mod tests {
cx.update_global::<SettingsStore, _>(|store, cx| {
store.update_user_settings::<ProjectPanelSettings>(cx, |project_panel_settings| {
project_panel_settings.auto_fold_dirs = Some(false);
project_panel_settings.auto_fold_dirs = false;
});
store.update_user_settings::<WorktreeSettings>(cx, |worktree_settings| {
worktree_settings.file_scan_exclusions = Some(Vec::new());
worktree_settings.file_scan_exclusions = Vec::new();
});
});
});
@ -5591,10 +5591,10 @@ mod tests {
cx.update_global::<SettingsStore, _>(|store, cx| {
store.update_user_settings::<ProjectPanelSettings>(cx, |project_panel_settings| {
project_panel_settings.auto_fold_dirs = Some(false);
project_panel_settings.auto_fold_dirs = false;
});
store.update_user_settings::<WorktreeSettings>(cx, |worktree_settings| {
worktree_settings.file_scan_exclusions = Some(Vec::new());
worktree_settings.file_scan_exclusions = Vec::new();
});
});
});