Dock: floating menu at the pointer, hover-only bar buttons, Allow docking, clip pallets

- The floating title bar's right-click menu opens where the pointer is,
  flipped to stay on screen; the Pallets submenu sits beside it.
- Close and pin on a floating title bar only show while it is hovered,
  as on docked title bars.
- New Allow docking check in that menu: off, dragging the window (or a
  pallet out of it) only floats it, never docks it on an edge.
- Floating windows and stacked pallets clip their content, so a pallet
  sized below its content no longer draws outside its frame.

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 11:18:42 +00:00
1 parent f19948bc07
commit 75fb9e32dd
27 files changed
+161 -25

No files matched your search

+17
View File
@@ -628,3 +628,20 @@ fn blockpalette_width_reset() {
let _ = app.on_dock(crate::ui::dock::DockMsg::WidthReset(id));
assert_eq!(app.dock.group_width(DockSide::Right, 0), 260.0);
}
#[test]
fn a_window_without_allow_docking_only_floats_when_dragged() {
use crate::ui::dock::{DockMsg, DropTarget, PanelId};
let mut app = dock_app();
let _ = app.on_dock(DockMsg::FloatOut(PanelId::BlockPalette));
let _ = app.on_dock(DockMsg::FloatDockingToggle(PanelId::BlockPalette));
assert!(!app.dock.float_rect(PanelId::BlockPalette).unwrap().docking);
// Dragged onto the left edge's strip, it stays a floating window.
let _ = app.on_dock(DockMsg::FloatGrab(PanelId::BlockPalette));
let _ = app.on_dock(DockMsg::DragMove(iced::Point::new(500.0, 300.0)));
let _ = app.on_dock(DockMsg::DragMove(iced::Point::new(10.0, 60.0)));
assert!(matches!(drag_target(&app), Some(DropTarget::Float { .. })));
let _ = app.on_dock(DockMsg::DragRelease);
assert!(app.dock.float_rect(PanelId::BlockPalette).is_some());
assert_eq!(app.dock.location(PanelId::BlockPalette), None);
}