Preserve editor input context through diagram help
This commit is contained in:
@@ -296,6 +296,7 @@ pub fn view(app: &App) -> View<'_, Message> {
|
||||
.padding([4, 16])
|
||||
.style(style::panel);
|
||||
let root = crate::allocation_input::root(app, column![header, task_nav, body, footer]);
|
||||
let root = crate::guide::protect_workspace(app.context_help, root);
|
||||
if app.context_help {
|
||||
return modal_width(
|
||||
root,
|
||||
@@ -495,7 +496,7 @@ fn diagram(app: &App) -> View<'_, Message> {
|
||||
.active_diagram
|
||||
.and_then(|id| app.project().diagrams.get(&id))
|
||||
.map(|d| d.projection);
|
||||
let modes = row![
|
||||
let mut modes = row![
|
||||
label("View content"),
|
||||
pick_list(
|
||||
[
|
||||
@@ -611,6 +612,26 @@ fn diagram(app: &App) -> View<'_, Message> {
|
||||
.center(Fill)
|
||||
.into()
|
||||
};
|
||||
if projection == Some(ProjectionKind::Allocation) {
|
||||
modes = modes.push(tooltip(
|
||||
action(
|
||||
if app.allocation_drag.arrange_next {
|
||||
"Arrange ✓"
|
||||
} else {
|
||||
"Arrange"
|
||||
},
|
||||
Message::WorkDrag(crate::app::allocation_drag::Event::ArrangeNext),
|
||||
),
|
||||
container(text(format!(
|
||||
"Arrange next drag · {}. Move work within its current allocation; Escape cancels.",
|
||||
crate::allocation_input::ARRANGE_SHORTCUT
|
||||
)))
|
||||
.padding(10)
|
||||
.max_width(420)
|
||||
.style(style::card),
|
||||
tooltip::Position::Bottom,
|
||||
));
|
||||
}
|
||||
let mut tools = column![toolbar].spacing(8);
|
||||
if app.active_diagram.is_some() {
|
||||
tools = tools.push(modes);
|
||||
@@ -645,25 +666,7 @@ fn diagram(app: &App) -> View<'_, Message> {
|
||||
.height(26)
|
||||
.width(Fill)
|
||||
.clip(true);
|
||||
tools = tools.push(
|
||||
row![
|
||||
destination_control,
|
||||
action(
|
||||
&format!(
|
||||
"{} · {}",
|
||||
if app.allocation_drag.arrange_next {
|
||||
"Arrange next drag: armed"
|
||||
} else {
|
||||
"Arrange next drag"
|
||||
},
|
||||
crate::allocation_input::ARRANGE_SHORTCUT
|
||||
),
|
||||
Message::WorkDrag(crate::app::allocation_drag::Event::ArrangeNext)
|
||||
)
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
);
|
||||
tools = tools.push(destination_control);
|
||||
}
|
||||
if let Some(diagram) = app.active_diagram {
|
||||
let view = oa_core::projection::project_view(app.project(), diagram);
|
||||
|
||||
Reference in New Issue
Block a user