Expand description
Arrangements, as a plugin (ArrangementsPlugin, in
DefaultPlugins): named layouts of the workbench, saved, switched
and reset. They are kept in the host’s store
(settings/workbench.arrangements, one versioned layout document per
name, and settings/workbench.arrangement, the current name), so they
are saved with the settings, or wherever a host keeps its store.
With the context stack (ADR 0012), the current arrangement is the
arranged frame’s: the last active mode that declares an
arrangement (FrameSpec::arrangement), else the top place, else the
root. The root’s name stays in settings/workbench.arrangement, as
it always was; each place’s and mode’s in
settings/workbench.arrangement.frames (a JSON object, frame id to
name), written when the user switches or saves there. A frame the
user never arranged starts from the arrangement it declares. Settings
files written before keep their meaning: their name is the root’s.
Applications offer templates, named layouts of their own
(Ctx::arrangement, owned by the plugin): switching to one starts from it, and resetting the
current arrangement goes back to its template (or to every panel in
its default area). A saved layout is repaired against today’s panels
when switched to (ADR 0003: what changed is said).
Saving without a name (workbench.arrangement.save with name
empty, as the View menu and the layout menu run it) asks for one in
a dialog, a new name suggested, when the dialogs plugin is there.
Steps (ADR 0011), each with its default:
| Step | Arguments |
|---|---|
arrangement.save | { "name" } |
arrangement.switch | { "name" } |
arrangement.reset | { "name" } (the current one) |
arrangement.delete | { "name" } |
Structs§
- Arrangement
Strings - The texts that name an arrangement, which an application may word its
own way (
AppBuilder::arrangement_strings): “Save the current arrangement as…” in the layout menu, the save dialog’s title and button, and the name it suggests ({ $n }: one more than the saved ones). Whole strings, not a word put into egui-pop’s sentences, so each language keeps its grammar. By default egui-pop’s own. - Arrangements
Plugin - The plugin.
Constants§
- ARRANGEMENTS
- Where the saved arrangements are: a JSON object, name to layout document.
- CMD_
RESET - CMD_
SAVE - CMD_
SWITCH - CURRENT
- The current arrangement’s name at the root of the context stack (the whole application without it).
- CURRENT_
BY_ FRAME - The current arrangement of each place and arranged mode of the context stack: a JSON object, frame id to name.
- DEFAULT
- The name of the arrangement every application starts with.
- STEP_
DELETE - STEP_
RESET - STEP_
SAVE - STEP_
SWITCH
Functions§
- arranged_
frame - The frame of the context stack whose arrangement is shown: the last
active mode declaring an arrangement, else the top place;
Noneat the root (or without the stack). With the arrangement it declares. - ask_
name - Asks for the name to save the current arrangement under, in a form
that runs
workbench.arrangement.savewith it;falsewithout the dialogs plugin. - by_
frame - The current arrangement of each frame the user arranged.
- current
- The current arrangement’s name: the arranged frame’s (see
arranged_frame), else the root’s. - delete
- Forgets a saved arrangement (
arrangement.delete). - layout_
of - The layout an arrangement names: a saved one, else a template, else
every panel in its default area for
DEFAULT. - names
- Every name to switch to: the saved ones and the templates.
- reset
- Puts the current arrangement back as its template has it (or every
panel in its default area), forgetting what was saved under its name
(
arrangement.reset). - save
- Saves the workbench’s layout as
name(arrangement.save). - saved
- The saved arrangements, by name.
- switch
- Switches to an arrangement (
arrangement.switch): a saved one, else a template.