Class TextModeThemeField
Inspector control for choosing a TextMode color theme: a dropdown of every usable theme palette, and a two-row swatch preview of the one currently selected.
Inherited Members
Namespace: Scylla.TextMode.Editor
Assembly: ScyllaTextMode.Editor.dll
Syntax
public static class TextModeThemeField
Remarks
The preview is split into the sixteen ANSI colors on one row and the semantic colors on the next, which is also the quickest way to spot a hand-authored palette whose ANSI block is out of order.
Two entry points exist because this has two kinds of consumer. Build(SerializedProperty, string) is bound to a serialized string and is what the configuration inspector, the terminal host inspector and the TextMode Wizard use; CreateLiveWidget(string) is unbound and applies the theme immediately, which is what a view inspector wants.
Methods
Build(SerializedProperty, string)
Builds a theme dropdown bound to a serialized string property, with a preview strip.
Declaration
public static VisualElement Build(SerializedProperty themeNameProp, string label)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedProperty | themeNameProp | The serialized theme-name string property. |
| string | label | Label shown next to the dropdown. |
Returns
| Type | Description |
|---|---|
| VisualElement | A container holding the dropdown and the swatch preview. |
CreateLiveWidget(string)
Builds a theme dropdown that applies the theme as soon as it is picked, with a preview strip and a button that returns to the classic theme.
Declaration
public static VisualElement CreateLiveWidget(string label)
Parameters
| Type | Name | Description |
|---|---|---|
| string | label | Label shown next to the dropdown. |
Returns
| Type | Description |
|---|---|
| VisualElement | A container holding the dropdown, the swatch preview and the reset button. |
Remarks
This drives TextModeThemes directly, so picking a theme in edit mode retints every view that follows the theme, the same way it would at runtime.