Class ScyllaDescriptionBox
A panel of explanatory prose introducing the section beneath it, shown or hidden by the
Editor / Inline Editor Descriptions menu toggle.
Implements
Inherited Members
Namespace: Scylla.Core.Editor
Assembly: ScyllaCore.Editor.dll
Syntax
public sealed class ScyllaDescriptionBox : VisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle
Remarks
Inspectors have had per-property descriptions for a while, sourced from tooltips and governed by the same toggle. This is the section-level counterpart: what a whole panel is about, rather than what one field means. A window that introduces a concept the user may be meeting for the first time needs somewhere to say so.
Reads the preference on every construction rather than caching it.
ShowPropertyDescriptions records why: an earlier cache
keyed on the frame count never refreshed in Edit mode, so a menu toggle did nothing
until the next domain reload. An EditorPrefs read is cheap enough that a UI
build path does not need one.
Construction covers a box built after the toggle changed. ApplyVisibility(VisualElement) covers the opposite case, a window already open when it changed, and is meant to be called from wherever a panel is activated.
Styling lives entirely in ScyllaControls.uss, which every editor surface loads
through ScyllaEditorStyleSheets.LoadShared. Nothing here sets a colour inline:
an inline style outranks a stylesheet in UI Toolkit, so a host wanting a different
treatment could not get one whatever it wrote.
Constructors
ScyllaDescriptionBox(string)
Initializes a description box.
Declaration
public ScyllaDescriptionBox(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The prose to show. |
Properties
IsEnabled
Gets whether description blocks are currently shown, per the editor preference the
Scylla menu toggles. Defaults to true, matching the inspector convention.
Declaration
public static bool IsEnabled { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Text
Gets or sets the prose shown in the box.
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
ApplyVisibility(VisualElement)
Re-reads the preference and applies it to every description box beneath a root.
Declaration
public static void ApplyVisibility(VisualElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | root | The element to search. |
Remarks
For surfaces that were already built when the menu was toggled. Call it from wherever a panel becomes visible: a tab switch is the cheapest moment to notice, and is the point at which a stale box would otherwise be seen.