Skip to main content

Module window_areas

Module window_areas 

Source
Expand description

Each application window’s own workbench: a centre, start and end side areas and a bottom area around the window’s content, each holding panels as tabs and splits, as the main window’s areas do (Layout::windows, saved with the layout).

Experimental: may change in any release (docs/stability.md).

A window with no panel in its areas draws its content alone, as before. Once a panel is placed in one of its areas, the window draws its start and end sides and its bottom around its content, and the panels of its centre beside it. A window opened with WindowSpec::centre_dock has no content: its centre is the whole middle, drawn even empty (a target for a tab dropped there), as the main window’s. Each area is a dock of the workbench’s one egui_stack space, which the main window’s areas and every window’s share (in-window:<window>:<area>): its tabs reorder, split and move between the window’s areas by drag and drop, and a tab dragged into another window’s area lands there, its new place saved with the layout (the space’s drag spans the windows, DockSpace::dragging). An area keeps out the panels the main window’s area of that name keeps out. Each tab’s menu is the panel menu, as in the main window.

§Its chrome

As in the main window: a side area folds to a strip (its grip unfolds it, an icon per panel opens that panel as a flyout over the window’s content) and the bottom folds out of sight (AppHandle::fold_window_area, saved in WindowAreas::folded); zen mode on one of its panels draws that panel alone in the window; each area and the window’s content are F6 regions.

§Where a panel opens (rule A)

pop.panel.open carries the window it was asked from (origin): a menu, a command or a key fills it in with the window it runs in. A closed panel opened again goes, in this order:

  1. where the application sends it: pop.panel.home answers a window (its topology’s home window, say), where it goes back to its last place when that was there, else docks in its own area;
  2. back to its last place, when that window is shown;
  3. in the window it was asked from, in its own area (its declared area, unless the application answers pop.panel.home_area);
  4. that window gone, in the main window while it shows the shell, else in the first window shown.

Never in a window closed, nor in the main window while another window’s content holds it.

Functions§

panels_by_window
The panels each window’s areas hold, by window id, as an agent reads them.