Move settings subscription to dock

Reduces likelihood of panels being unable to move themselves
This commit is contained in:
Conrad Irwin 2024-01-13 22:35:33 -07:00
parent fee369bca1
commit 898645681f
6 changed files with 13 additions and 62 deletions

View file

@ -246,18 +246,6 @@ impl ProjectPanel {
};
this.update_visible_entries(None, cx);
// Update the dock position when the setting changes.
let mut old_dock_position = this.position(cx);
ProjectPanelSettings::register(cx);
cx.observe_global::<SettingsStore>(move |this, cx| {
let new_dock_position = this.position(cx);
if new_dock_position != old_dock_position {
old_dock_position = new_dock_position;
cx.emit(PanelEvent::ChangePosition);
}
})
.detach();
this
});