Commit Graph
214 Commits
Author SHA1 Message Date
aiongg 95d5cddb5f docking: a canvas that accepts splits stays protected
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.
2026-10-20 15:07:24 +00:00
aionggandfilipessmedeiros-collab 07585888d6 docking: floating windows resize from the top edge and corners
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>
2026-10-20 03:51:38 +00:00
aiongg 72a0a4dc78 docking: rustfmt 2026-10-20 03:51:13 +00:00
aiongg 46f2ffd654 docking: a press in a group header focuses the shown panel
Host widgets in the header, such as a menu button or the host's own tabs,
focus the panel the way a press on its tab or body does.
2026-10-20 03:47:12 +00:00
aiongg 91e8cf401e docking: chrome_has_focus recognizes every control a Hit names
It checks the same widget ids as hit_rects and hit_id, which adds icons and
icon grips.
2026-10-20 03:46:31 +00:00
aiongg 815d648016 docking: split divider hits name the layout path while panels are hidden
A split's handle id and its Hit::Divider use the layout path that
ResizeSplit takes, also when hiding panels collapses a split in the drawn
tree.
2026-10-20 03:45:18 +00:00
aiongg ae0c19b49b docking: hidden floating windows do not cover dock targets
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.
2026-10-20 03:44:25 +00:00
aiongg a55cbe870e docking: a huge wheel delta over a tab strip stops at the last tab
The step count saturates instead of overflowing the index subtraction.
2026-10-20 03:42:52 +00:00
aiongg cef258a356 docking: a column's first tab docks beside its own column
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.
2026-10-20 03:42:36 +00:00
aiongg ceb75f965e ui: use US spelling 2026-10-20 03:24:45 +00:00
aiongg 3600104e76 docking: rustfmt the new tests 2026-10-20 01:00:56 +00:00
aiongg 95c81fa6de docking: say that the drag bar's menu opens on a right click
A left click on the drag bar focuses it and opens nothing, as designed;
the Hit::DragBar docs said otherwise.
2026-10-20 01:00:30 +00:00
aiongg a76d196b80 docking: dividers and resize grips keep focus after a pointer drag
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.
2026-10-20 01:00:22 +00:00
aiongg 877f676e19 docking: menu item labels in title case
Float Panel, Close Panel and Move Group To match the other menu items.
Control names that only screen readers announce stay in sentence case.
2026-10-20 00:59:33 +00:00
aiongg 38e2b27a30 docking: window.panel.dock with an edge zone and no anchor docks at that edge
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.
2026-10-20 00:59:02 +00:00
aiongg 89849272a0 docking: public widget ids and floating window layers
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.
2026-10-20 00:58:10 +00:00
aiongg 30cebdc0f2 docking: content that fills its body floats at floating_size or 320
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.
2026-10-20 00:57:14 +00:00
aiongg b94df6c8b6 docking: wheel selects tabs and middle click closes a tab
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.
2026-10-20 00:55:43 +00:00
aiongg d3079230da docking: group_header_width gets the tab strip width
A header that draws its own tabs, such as a timeline's open sequences,
sizes them to the room the strip has.
2026-10-20 00:54:23 +00:00
aiongg 787b706274 docs: say when a tab is cut and that the drag bar keeps its width 2026-10-19 15:37:00 +00:00
aiongg 13be52fbaa docking: focus only follows the user's input 2026-10-19 14:06:37 +00:00
aiongg a014337eb2 docking: a floated group takes its content height 2026-10-19 14:06:37 +00:00
aiongg e1b7733a1d docking: tabs keep their names and the rest go to the overflow menu 2026-10-19 14:02:05 +00:00
aiongg bfda13d2af docking: a tab dragged to an edge without a dock makes one
A tab that shares its group moves alone into the new dock with Action::MovePanel, as
window.panel.dock does (P6).
2026-10-19 13:32:15 +00:00
aiongg 9359332fd7 panes: the API example gives the document focus on to_document 2026-10-19 13:30:02 +00:00
aiongg 4325b9ccc1 docking: move_targets skips the panel's own group
Moving a panel to a tab of its own group only reorders it, so a panel whose only other tabs are
in its group gets no "Move Panel to Group" menu.
2026-10-19 13:30:02 +00:00
aiongg b64cc4eac6 docking: window.panel.minimize toggles an accordion entry both ways
Without minimized the command read only dock and floating groups, so a closed accordion entry
stayed closed.
2026-10-19 13:30:02 +00:00
aiongg 5d5d11f854 docking: window.panel.dock to a side without a dock moves one panel of a shared group
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.
2026-10-19 13:30:02 +00:00
aiongg c715d3f25f docking: hosts seed a FloatSpace with panel sizes 2026-10-19 13:22:34 +00:00
aiongg 6261d9d39a docking: DockCommand takes the float space 2026-10-19 13:11:07 +00:00
aiongg 3aded979b5 docking: report flyout changes with DockEvent::FlyoutChanged 2026-10-19 13:07:52 +00:00
aiongg f46828ea48 docking: float commands without a rect at the drag size inside the dock area 2026-10-19 13:07:03 +00:00
aiongg d91e5f6aea docking: paint panel icons in code with DockContent::paint_icon 2026-10-19 13:04:52 +00:00
aiongg f4f9e5b206 docking: one drop preview painter for docking and panes
chrome::drop_preview draws the accent outline, filled or not, for every
docking destination and drag ghost and for the pane host's drop preview.
2026-10-19 12:26:31 +00:00
aiongg 6820f98109 panes: reserve the exact pane size, clip the body and name each title bar
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).
2026-10-19 12:25:49 +00:00
aiongg 8a0df8c12f docking: fixes from DesignCraft trial step 2
- 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.
2026-10-19 12:24:38 +00:00
aiongg 9c909dba7f docking: merge iconic columns, DockCommand, hit rects, the test driver and the guide
Adds the auto-collapse label to the keyed label hook and returns closed panels from DockCommand::apply through Workspace::apply_all.
2026-10-19 12:12:40 +00:00
aiongg b98ef89921 docking: rewrite the docking guide for the current API
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.
2026-10-19 12:07:14 +00:00
aiongg 0d350d8e11 docking: DockCommand for the shared command ids and the ui.dock operations
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.
2026-10-19 11:59:33 +00:00
aiongg 0c140eb65b docking: iconic columns with flyouts, hit rects and a test driver
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).
2026-10-19 05:40:26 +00:00
aiongg c94ab4d313 docking: merge craft_ui::panes, the task-pane host for document apps 2026-10-19 05:38:27 +00:00
aiongg 3893c590b0 docking: group float size, elided tab labels, filled ghost, drag bar grip, tab focus and double-click fixes
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
2026-10-19 05:38:00 +00:00
aiongg 418344c5ad docking: keyed label hook, closed panels from Workspace::apply, borrowed Floating::contains
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
2026-10-19 05:38:00 +00:00
aiongg a09aa016e3 panes: docs with adoption steps for WordCraft, DeckCraft, GridCraft 2026-10-19 05:36:18 +00:00
aiongg 484717644c panes: task-pane host for document apps
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.
2026-10-19 05:36:18 +00:00
aiongg 87e6562a5e ui: chrome live_move for title-bar moves
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.
2026-10-19 05:36:18 +00:00
aiongg 315fde3ed8 docking: test window title drags onto dock seams and new-dock bands 2026-10-19 05:27:17 +00:00
aiongg d37d9aeff3 docking: merge floating windows, frame profile and native windows
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.
2026-10-19 05:27:17 +00:00
aiongg a842d330e0 docking: test that hidden panels map split resizes to layout paths 2026-10-19 05:22:03 +00:00
aiongg e235c4c183 docking: rustfmt and clippy for the floating and frame changes 2026-10-19 05:21:35 +00:00