simvx.editor.layout_presets

Layout Presets — Serialize and restore DockContainer state with built-in presets.

Module Contents

Classes

LayoutPresets

Manages editor layout presets (built-in and user-defined).

Data

API

simvx.editor.layout_presets.log

‘getLogger(…)’

simvx.editor.layout_presets.BUILTIN_PRESETS: dict[str, dict]

None

simvx.editor.layout_presets.USER_PRESETS_PATH

None

class simvx.editor.layout_presets.LayoutPresets[source]

Manages editor layout presets (built-in and user-defined).

Initialization

get_preset(name: str) dict | None[source]

Return preset data by name, preferring custom over built-in.

save_preset(name: str, layout: dict)[source]

Save a custom preset (persists to disk).

delete_preset(name: str) bool[source]

Delete a custom preset. Built-in presets cannot be deleted.

list_presets() list[str][source]

Return all preset names (built-in first, then custom).

apply_preset(name: str, shell) bool[source]

Apply a layout preset to the editor shell’s DockContainer.

Args: name: Preset name. shell: Object with a _dock attribute (the editor’s DockContainer).

Returns: True if applied, False if preset not found or no dock available.

capture_layout(shell) dict | None[source]

Capture the current dock layout from the editor shell.

Returns: Layout dict, or None if no dock is available.