Hiding panels and dropping the tab strip tested for exactly
Permissions::PROTECTED, so a canvas set up as the docs describe
(accepts_splits on) was hidden and got a tab strip. Permissions::is_protected
decides from what the panel allows.
A resizable FloatingFrame keeps a 4 pt band above its contents for the
Top, TopLeft and TopRight handles, so they take no title bar moves or
button clicks. They keep the opposite edges in place, respect the size
limits and the screen, take arrow keys when focused, and have hit ids.
Moves carry the whole frame rect, band included.
Ported from #189.
Co-authored-by: filipessmedeiros-collab <343926472+filipessmedeiros-collab@users.noreply.github.com>
Dock targets check the floating windows drawn this frame instead of every
window's last egui area rect. floating_layer says that an undrawn window
keeps its last area rect.
A dock target named by the dragged panel itself anchors on another panel
of the same group or column, or leaves the panel in place when it is alone
there, instead of failing with InvalidPlacement.
Arrow keys resize the handle right after a drag. Focus that came from
the pointer draws no highlight until a key is pressed, and hovering
still focuses nothing.
A left, right, top or bottom zone without anchor or side maps to
Placement::Edge, anchored on any docked panel that does not move. A
hidden panel is shown and moved in one step, all or nothing.
DockArea::hit_id gives the egui id of the control a Hit names, and
DockArea::floating_layer the layer of a floating window, so apps and
their tests stop rebuilding internal ids. The divider between stacked
groups has one id in docks and floating windows.
A panel body that reaches the bottom of its rect has no height of its
own, so a floated panel or group falls back to floating_size, else 320
points, instead of the whole frame height. A body in a window fitted to
its recorded height keeps that height. Panels leaving a frame fit their
content like panels leaving a dock.
Both are on in the Frame profile and off by default in the Dock profile;
DockStyle::wheel_selects_tabs and middle_click_closes_tabs set them. A
middle click closes only a closable panel.
Action::MovePanel moves one panel to a Target; NewDock and Float give it a group of its own.
DockCommand::Dock with a side that has no dock used to fail with InvalidPlacement for a panel
that shares its group.
A docked pane draws its body in a child ui clipped to the pane, so a body
wider than the pane no longer shifts a right or bottom pane's reserved
rect into the document. PaneLabels::move_pane takes {title}, so each
title bar's accessible name includes its pane ("Move Styles pane").
Pane title bars mirror with .rtl(true).
- Permissions::accepts_splits; PROTECTED takes no side splits, so a
group dropped on a protected canvas floats.
- A press of any pointer button in a panel body, stripless panels
included, reports the panel in DockOutput::focused.
- Right to left, tab strips, their header and drag bar, insertion slots
(DropTarget::right_to_left), accordion headers and chrome::TitleBar
(ChromeStyle::right_to_left) mirror. TitleBar truncates galley titles
like tab labels.
- DockStyle::close_menu_items and close_button hide the built-in close
controls without changing Permissions::closable.
- Menu labels say what moves: Move Panel to Group (move_panel_to_label)
and Move Group to (move_group_to_label).
- The column bar's button has its own accessibility labels
(collapse_column_label, expand_column_label).
- Placement::for_zone maps zones onto what the anchor's container takes;
DockCommand uses it and takes right_to_left.
- Layout::apply, apply_with_permissions and apply_all return the closed
panels.
- Placement::Group takes an optional preferred height.
docs/ui-docking.md covers the Dock and Frame profiles, the model and
actions, Workspace, the renderer and DockContent, gestures, DockCommand,
DockStyle::localized, hit rects and the DockDriver test driver, and links
the task-pane guide.
Also: ui.dock open, close and activate map in one place, the command tests
build as a cfg(test) module, the hit-kind table gets a type alias, the
testing example uses public API, and rustfmt.
DockCommand<P> deserializes a control command's params, with its id under
"command", and maps it to layout actions applied all or none. It covers the
window.panel.* and window.workspace.* ids, the raw {action} form, and the
ui.dock {operation, …} shape of LightCraft, PDFCraft, CADCraft and
SoundCraft (open, close, activate, float, moveFloating, move, setStackOpen,
resizeStack, resizeSplit), so their parsers can go without a protocol change.
Named workspaces and Reset stay with the application.
tests/docking_workflows.rs loads every v1 fixture, docks groups by their bars
into a new dock, a bottom band and a seam, collapses and expands the column,
floats it by command, drags it back, and checks the layout reads back as
written.
An iconic column draws one icon per panel, a grip above each group and a
separator between groups (M3). Widened past `DockStyle::iconic_label_width`
it shows panel names (M4). Clicking an icon opens its group as a flyout on
the canvas side; another icon switches, the same icon closes, and with
Auto-Collapse Iconic Panels (default on) Escape or a press outside closes
it (M5). Dragging a flyout's strip floats its group (M6), an icon drags its
panel (S7) and the grip its group (S8). A drop into an iconic column makes
a new icon group, previewed by the column outline and an insertion line
(P9). `raise_panel` on an iconic panel opens its flyout (U3), and the
column menu has the Auto-Collapse toggle as `DockEvent::ToggleAutoCollapse`.
Iconic widths move to `DockStyle` (`icon_size`, `iconic_width`,
`iconic_max_width`). `DockArea::hit_rects` names every gesture source the
area drew last frame, and `docking::testing::DockDriver` (feature
`testing`) drives an area with real egui input for application tests.
Behaviour follows vectorcraft crates/ui-egui/src/dock.rs (icon column,
flyout placement, names when widened) and photocraft dock.rs
(auto-collapse).
A floated group or column keeps its width and takes the tallest member's floating size, else the docked height capped at 320 pt. Tab labels from pre-laid-out galleys are cut with an ellipsis and drawn left-aligned inside the tab, active tabs included. The group drag ghost has a translucent fill, a 2 pt outline and the members' labels. The drag bar draws a grip mark at rest. A click that expands a minimized group does not start a double-click that minimizes it again. A tab focused by the pointer shows no focus outline; keyboard focus still does.
Found in the DesignCraft trial
DockStyle::localized translates every *_label field through one keyed function. Workspace::apply and apply_all return the panels they closed. Floating::contains takes any borrowed form of the panel id.
Found in the DesignCraft trial
PaneHost draws the open panes as egui side and bottom panels before the app's
CentralPanel, or as floating frames, each with a title, a ▾ menu (app items,
Move to Start/End, Float, Close), × and a resize edge. Edges are logical
(Start/End) with an RTL flag. Columns shows every pane side by side; OneSlot
shows one closable pane per edge. The app owns open state and pane state: the
host returns Close, Place, Resize, FloatRect and Focus requests, the focused
pane, and cycles focus with F6.
Drag-out-to-float and edge snap follow wordcraft#2584.
Moves a rect with a title-bar drag from the rect and press position kept at
drag start, so the window follows the pointer without drift. Escape or window
focus loss ends the move and returns the start rect.
Merge the docking-t4 track (floating title bars and stacks, frame
profile, native windows, public chrome) into the dock profile track.
Integration:
- DockStyle keeps two edge bands: `edge_band` (8) is the outer edge
band that splits at the root; `new_dock_band` (12) is the band along
the docked area's left and right edges that makes a new dock. One
`seam_band` serves dock seams and floating stack seams.
- New-dock targets are offered in the dock profile rather than only in
layouts that already have a dock.
- Window title bar drags take the dock targets: a column edge makes a
new column, a seam or group band stacks the window's groups there,
the new-dock band makes a dock. They still never split a frame or
join a body centre. Tab drags check dock targets before floating
stack and outer edge targets.
- One group_action maps column, window and group gestures to
MoveColumn, MoveWindow and MoveGroup.
- The unused stacked_groups renderer is gone; docks and floating
windows each draw their own stacks.