Vixen
02b45cc4
csharp
public sealed class DockLayout

A whole docking arrangement: what is docked, and what is floating over it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ YAML rather than the binary serializer, and rather than reflection. A window layout is something a person diffs, checks in and occasionally repairs by hand — the same argument doc 11 makes for project settings — and it is built here node by node rather than through YamlSerializer so that nothing has to be registered, nothing is reflected over, and the format is whatever this file says it is rather than whatever a converter decided.

Fields and properties (2)

  • public DockNode? Root

    The docked arrangement, or null if nothing is docked.

  • public IReadOnlyList<DockFloat> Floating

    The groups floating over it.

Methods (15)

  • public void AddFloating(DockFloat window)

    Adds a floating group.

  • public void RemoveFloating(int index)

    Takes a floating group out.

  • public void SetFloating(int index, DockFloat window)

    Replaces a floating group, which is how one is moved or resized.

  • public List<DockGroupNode> Groups()

    Every group in the arrangement, docked ones first.

  • public (DockGroupNode Group, int Index)? Find(string id)

    Which group holds a panel, and where in it.

  • public string Save()

    Writes the arrangement as YAML.

  • public static DockLayout Load(string yaml)

    Reads an arrangement back.

  • public void Dock(string id, DockGroupNode target, DockZone zone, int index = -1)

    Puts a panel somewhere, taking it out of wherever it was.

  • public bool RemovePanel(string id)

    Takes a panel out of the arrangement altogether.

  • public void Float(string id, float x, float y, float width = 320, float height = 240)

    Takes a panel out of the docked tree and puts it in a window of its own.

  • public bool Replace(DockNode node, DockNode replacement)

    Swaps one node of the tree for another.

  • public void Prune()

    Drops the empty groups and collapses the splits that lost a half.

  • public int IndexOfFloating(DockGroupNode group)

    Which floating entry holds a group.

  • public List<DockGroupNode> DockedGroups()

    Every group in the docked tree, floating ones excluded.

  • public bool Contains(DockGroupNode group)

    Whether a group is still part of the arrangement.

Used by (10)

  • ShellHelloUi
  • DockReorderTestsVixen.Ui.Controls.Advanced.Tests
  • DockingHostVixen.Ui.Controls.Advanced
  • DockingTestsVixen.Ui.Controls.Advanced.Tests
  • DockingWindowTestsVixen.Ui.Controls.Advanced.Tests
  • DockingWorkspaceVixen.Editor.Ui
  • EditorShellVixen.Editor.Ui
  • LayoutPresetsVixen.Editor.Ui
  • PluginContextVixen.Editor.Plugin
  • WorkspaceTestsVixen.Editor.Ui.Tests