recenter on show

This commit is contained in:
galister
2024-02-04 02:11:32 +01:00
parent e384e96939
commit b5d970e5fd
8 changed files with 32 additions and 13 deletions

View File

@@ -97,7 +97,7 @@ where
self.overlays.values_mut()
}
pub fn show_hide(&mut self) {
pub fn show_hide(&mut self, app: &mut AppState) {
let any_shown = self
.overlays
.values()
@@ -106,6 +106,9 @@ where
self.overlays.values_mut().for_each(|o| {
if o.state.show_hide {
o.state.want_visible = !any_shown;
if o.state.want_visible && app.session.recenter_on_show {
o.state.reset(app, false);
}
}
})
}