Dock: drop dead pallet-width setters, split on_dock, share span maths

- Only docked pallets have a width divider, so the Width drag and
  WidthReset no longer carry a branch for an undocked pallet; remove the
  then unused DockState::set_width / reset_width. Per-pallet widths are
  still read (older configs, floating size). Tests now size groups.
- on_dock hands hover messages to dock_hover and the release to
  dock_drag_release.
- dock_slot_spans and dock_landing share dock_open_spans.

No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013RyGiMXcsf9HTKfqDxaQGt
This commit is contained in:
Claude committed 2026-10-10 12:34:02 +00:00
1 parent 02404301a5
commit cc17d10ca9
4 files changed
+111 -107

No files matched your search

+4 -7
View File
@@ -690,13 +690,10 @@ impl OpenCADStudio {
}
let (side, gi) = after.location(id)?;
let group = &after.groups(side)[gi];
let open: Vec<usize> = (0..group.panels.len())
.filter(|i| group.panels[*i] == id || self.dock_panel_visible(group.panels[*i]))
.collect();
let weights: Vec<f32> = open.iter().map(|i| group.weights[*i]).collect();
let at = open.iter().position(|i| group.panels[*i] == id)?;
let (_, avail) = self.dock_workspace_size();
let (top, bottom) = *crate::ui::dock::slot_spans(&weights, avail).get(at)?;
let (_, top, bottom) = self
.dock_open_spans(group, Some(id))
.into_iter()
.find(|(i, _, _)| group.panels[*i] == id)?;
Some((top, bottom, after.group_width_px(side, gi, self.win_size.0)))
}