Module layout

Source
Expand description

Dockable editor layout (egui_tiles): panes can be rearranged by dragging their tabs, split, tabbed, hidden/shown, popped out into their own OS windows (egui immediate viewports) and saved/loaded as profiles (JSON — also written to / read from .sedit-layout files so profiles can be shared).

Default layout (DaVinci-like), two rows of four columns: top = [Library | Preview with the Tools strip beneath it | Inspector | tabs(Curves, Nodes, Tracking)] bottom = [tabs(Effects, Transitions, Presets) | Timeline | tabs(Mixer, Auto-cut, Subtitles) | tabs(Markers, Planner)]. The Timeline is a column of its own rather than a tab, so nothing can ever hide it. show draws the tree in the given ui and each popped pane in its own viewport (closing that window docks the pane back); draw(ui, pane) renders a pane. Behaviour: tab titles = Pane::title, a pop-out button in the tab bar puts the active pane in its own window, a cross hides it. Hidden panes stay in the tree (egui_tiles visibility) so they come back exactly where they were.

Dragging a tab paints nine drop squares over the tile under the cursor (centre = tabify, the eight around it = split), the dropped pane keeps the fraction of its parent it had instead of taking half of wherever it landed, and the move goes onto a small undo stack of its own so Ctrl+Z puts it back.

Migration: a stored layout from an older version does not know the round-3 panes; from_json rejects it (None) so the app falls back to this default instead of an editor with no Tools/Mixer/Markers.

Structs§

Behaviour 🔒
Layout
The whole layout: the docked tree plus panes currently popped out into their own windows.

Enums§

Pane

Functions§

activate_orphan_tabs 🔒
Draw the docked tree into ui and every popped pane in its own OS window; draw(ui, pane) renders a pane’s content. A popped window that the user closes is docked back automatically. Returns (layout changed this frame — caller persists it, a pane was dropped somewhere new). Repair tab containers whose active no longer names one of their children — which is what leaves a lone tab drawn as inactive after a rearrange, so it has to be clicked before its pane comes back.
keep_share_fraction 🔒
Give a just-dropped tile the same fraction of its new parent as it had in the old one: a fresh split hands out 1:1 shares, which silently halves whatever you dropped the pane onto.
profile_button
One entry of the “Load profile” menu. A menu sizes itself from the previous frame’s content, so a name that wraps makes the menu narrower, which wraps it harder — after a few frames “Editor 1” has collapsed to “Edito / r 1”. Measuring the name pins the width instead of letting it feed back, and anything past the cap truncates on one line with the whole name on hover.
share_fraction 🔒
How much of its linear parent a tile takes up (None when the parent is a tab bar — a tab has no share).
show