Make panels independently resizable

This commit is contained in:
Nathan Sobo 2023-05-11 23:25:05 -06:00
parent 5549669316
commit 214354b4da
8 changed files with 135 additions and 154 deletions

View file

@ -1347,12 +1347,9 @@ impl Entity for ProjectPanel {
impl workspace::dock::Panel for ProjectPanel {
fn position(&self, cx: &gpui::WindowContext) -> DockPosition {
let settings = cx.global::<Settings>();
let dock = settings
.project_panel_overrides
.dock
.or(settings.project_panel_defaults.dock)
.unwrap();
match dock {
match settings
.project_panel
.dock {
settings::ProjectPanelDockPosition::Left => DockPosition::Left,
settings::ProjectPanelDockPosition::Right => DockPosition::Right,
}
@ -1374,6 +1371,10 @@ impl workspace::dock::Panel for ProjectPanel {
})
}
fn default_size(&self, cx: &gpui::WindowContext) -> f32 {
cx.global::<Settings>().project_panel.default_width
}
fn icon_path(&self) -> &'static str {
"icons/folder_tree_16.svg"
}