Keep allocation destinations readable without blocking collapsed header drops
This commit is contained in:
@@ -510,6 +510,31 @@ fn diagram(app: &App) -> View<'_, Message> {
|
||||
tools = tools.push(modes);
|
||||
}
|
||||
if projection == Some(ProjectionKind::Allocation) {
|
||||
// Reserve this slot even when idle: changing feedback must never resize
|
||||
// the measured canvas and invalidate a held gesture. Its identity is
|
||||
// independent of status length, target geometry and the diagram zoom.
|
||||
let destination = app
|
||||
.allocation_drag
|
||||
.feedback
|
||||
.as_ref()
|
||||
.map(|feedback| feedback.destination_identity())
|
||||
.unwrap_or_else(|| "None · drag work to choose".into());
|
||||
tools = tools.push(
|
||||
container(tooltip(
|
||||
text(format!("Destination: {}", short(&destination, 28)))
|
||||
.size(13)
|
||||
.wrapping(widget::text::Wrapping::None),
|
||||
container(text(destination).size(13))
|
||||
.padding(10)
|
||||
.max_width(420)
|
||||
.style(style::card),
|
||||
tooltip::Position::Top,
|
||||
))
|
||||
.id("allocation-destination")
|
||||
.height(26)
|
||||
.width(Fill)
|
||||
.clip(true),
|
||||
);
|
||||
tools = tools.push(
|
||||
row![
|
||||
action(
|
||||
@@ -561,7 +586,7 @@ fn diagram(app: &App) -> View<'_, Message> {
|
||||
"Right-click for actions · drag to arrange · scroll to zoom"
|
||||
};
|
||||
// Status is outside the measured canvas. Clipping prevents long text
|
||||
// from painting over work headers or frozen target labels below it.
|
||||
// from painting over work headers or the dedicated destination slot.
|
||||
tools = tools.push(container(label(hint)).height(30).width(Fill).clip(true));
|
||||
}
|
||||
column![container(tools).padding(14), canvas].into()
|
||||
|
||||
Reference in New Issue
Block a user