public sealed class SettingsViewThe window behind both Preferences and Project Settings: a rail, a pane, and an Apply.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Doc 20's A4 is "two windows, one mechanism", and this is the mechanism. The only difference between Preferences and Project Settings is whose store the pages are over — the user's or the project's — so a second implementation of the rail, the search, the reset and the dirty tracking would be a second place for those four to be subtly wrong.
⚠ A panel rather than a modal, and doc 20's A2 is why. Everything modal in this editor is a drawn Dialog in the shell's own document, so that the golden suite can photograph it and the automation harness can drive it — and a settings window is the one thing people leave open beside what they are changing. Registered as a panel, it docks, it tabs, and view.float-panel gives it a real operating-system window when the user wants one, which is the same answer doc 20's "two windows" asks for by a different route.
⚠ Nothing is written on a keystroke. Doc 20 is explicit: the layout file's rule — written on the way down — applies here for the same reason, with an explicit Apply for anything that costs something to change. So an edit marks the window dirty, Apply is what commits, and Revert rebuilds the page from what is still on disk.
Fields and properties (13)
protected override string TagNameThe element name this type answers to when a caller does not choose one.
protected override bool AcceptsFocusWhether the focus can rest on this kind of control at all.
public SearchBox SearchThe search box over every setting on every page.
public UiElement RailThe list of pages down the left.
public UiElement PaneWhere the chosen page is built.
public UiElement FooterThe strip along the bottom.
public Button ResetPagePuts this page back to its defaults.
public Button RevertThrows away what has been typed since the last write.
public Button ApplyWrites it.
public IReadOnlyList<SettingsCategory> CategoriesThe pages, in the order they were added.
public string? CurrentWhich page is showing, or before one has been chosen.
public string? QueryWhat the search box says, or when it is empty.
public bool IsDirtyWhether something has been edited and not yet written.
Events (3)
public Action<SettingsView>? AppliedRaised when the user asks for the edits to be written.
public Action<SettingsView>? RevertedRaised when they ask for them to be thrown away.
public Action<SettingsView, UiElement>? PageShownRaised with the pane whenever the page or the search text changes.
Methods (4)
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
public SettingsCategory Add(SettingsCategory category)Adds a page.
public bool Select(string id)Shows a page.
public void Reload()Builds the current page again, from whatever the model now says.
Used by (2)
- EditorApplicationVixen.Editor.App
- SettingsWindowTestsVixen.Editor.App.Tests