Remove obsolete canvas panel focus mode
This commit is contained in:
@@ -227,35 +227,12 @@ pub fn view(app: &App) -> View<'_, Message> {
|
||||
Page::Validation => checks(app),
|
||||
Page::Guide => crate::guide::view(&app.guide),
|
||||
};
|
||||
let process_layout = app.topology_context().is_some();
|
||||
let scenario_layout = app.scenario_context().is_some();
|
||||
let focus_behavior = (process_layout && app.behavior.topology.focused)
|
||||
|| (scenario_layout && app.behavior.scenario.focused());
|
||||
let mut body = if app.page == Page::Home {
|
||||
row![container(main).width(Fill).height(Fill)].height(Fill)
|
||||
} else if process_layout || scenario_layout {
|
||||
// Keep main at the same widget-tree path across Focus toggles. The
|
||||
// collapsed slot has no controls, so it cannot paint over or hit the canvas.
|
||||
let process_sidebar: View<'_, Message> = if focus_behavior {
|
||||
Space::new().width(0).into()
|
||||
} else {
|
||||
sidebar.into()
|
||||
};
|
||||
// Row::push would discard the zero-width slot and shift main again.
|
||||
widget::Row::from_vec(vec![
|
||||
container(process_sidebar)
|
||||
.width(if focus_behavior { 0 } else { 260 })
|
||||
.height(Fill)
|
||||
.clip(true)
|
||||
.into(),
|
||||
container(main).width(Fill).height(Fill).into(),
|
||||
])
|
||||
.width(Fill)
|
||||
.height(Fill)
|
||||
} else {
|
||||
row![sidebar, container(main).width(Fill).height(Fill)].height(Fill)
|
||||
};
|
||||
if !focus_behavior && !matches!(app.page, Page::Home | Page::Text | Page::Guide) {
|
||||
if !matches!(app.page, Page::Home | Page::Text | Page::Guide) {
|
||||
body = body.push(inspector(app));
|
||||
}
|
||||
let footer = container(
|
||||
|
||||
Reference in New Issue
Block a user