Window Framework v1.2.4
Window Framework for Unity UI Toolkit
Loading...
Searching...
No Matches
GWG.WindowFramework.Editor.WindowFrameControllerEditor Class Reference

Custom editor class for the WindowFrameController component, designed using UI Toolkit. More...

Inheritance diagram for GWG.WindowFramework.Editor.WindowFrameControllerEditor:

Public Member Functions

override VisualElement CreateInspectorGUI ()

Private Member Functions

void BuildInspectorUI ()
VisualElement CreateControllerFields ()
 Creates the UI fields for the controller-specific properties.
VisualElement CreateFieldForProperty (SerializedProperty property, string label)
 Creates a UI field for the given serialized property to use in the inspector.
VisualElement CreateHeader ()
 Creates a header element containing an icon and descriptive text for the Window Frame Controller.
VisualElement CreateSpace (int height)
 Creates a spacer element with the specified height.
void LoadStyles ()
void RefreshThemeDataSection ()
 Rebuilds and updates the theme data section within the inspector UI.

Private Attributes

VisualElement _root
VisualElement _themeDataContainer

Static Private Attributes

const string EditorThemePath = "WindowFramework/Themes/WFW-EditorTheme/WFW-EditorTheme"

Detailed Description

This class provides a custom user interface in the Unity Inspector for editing WindowFrameController settings. It utilizes the VisualElement system to dynamically generate the inspector UI and applies custom styles.
The editor listens for external theme changes and updates its UI accordingly to reflect the current theme data settings of the associated WindowFrameController.

See also
UnityEditor.Editor

Member Function Documentation

◆ BuildInspectorUI()

void GWG.WindowFramework.Editor.WindowFrameControllerEditor.BuildInspectorUI ( )
private

◆ CreateControllerFields()

VisualElement GWG.WindowFramework.Editor.WindowFrameControllerEditor.CreateControllerFields ( )
private
Returns
A UnityEngine.UIElements.VisualElement containing the controller-specific fields.

This method creates the UI fields for the controller-specific properties, including the UI Document field, Tooltips Enabled field, Memory Enabled field, Data File Name field, Default Stylesheet field, Global Stylesheet field, Global Load Order field, and Theme Data field.

◆ CreateFieldForProperty()

VisualElement GWG.WindowFramework.Editor.WindowFrameControllerEditor.CreateFieldForProperty ( SerializedProperty property,
string label )
private
Parameters
propertyThe SerializedProperty representing the target property to bind to the field.
labelThe label to display alongside the created field.
Returns
A UnityEngine.UIElements.VisualElement representing the created field, with the property and label bound.

◆ CreateHeader()

VisualElement GWG.WindowFramework.Editor.WindowFrameControllerEditor.CreateHeader ( )
private
Returns
A UnityEngine.UIElements.VisualElement representing the header section.

This method generates a styled header comprising an optional icon and a text container with a title and description. The header is intended to provide an overview for the Window Frame Controller UI.

◆ CreateInspectorGUI()

override VisualElement GWG.WindowFramework.Editor.WindowFrameControllerEditor.CreateInspectorGUI ( )

◆ CreateSpace()

VisualElement GWG.WindowFramework.Editor.WindowFrameControllerEditor.CreateSpace ( int height)
private
Parameters
heightThe height of the spacer in pixels.
Returns
A UnityEngine.UIElements.VisualElement with the specified height.

This method generates a VisualElement to be used as a spacer in the UI layout, setting its height to the specified value for consistent spacing between elements.

◆ LoadStyles()

void GWG.WindowFramework.Editor.WindowFrameControllerEditor.LoadStyles ( )
private

◆ RefreshThemeDataSection()

void GWG.WindowFramework.Editor.WindowFrameControllerEditor.RefreshThemeDataSection ( )
private

This method clears the current theme data section and reconstructs it based on the latest state of the associated WindowFrameController object. If the theme data is present, a new section is created and added to the UI. Tracking variables are updated to reflect the current controller and theme data.

Member Data Documentation

◆ _root

VisualElement GWG.WindowFramework.Editor.WindowFrameControllerEditor._root
private

◆ _themeDataContainer

VisualElement GWG.WindowFramework.Editor.WindowFrameControllerEditor._themeDataContainer
private

◆ EditorThemePath

const string GWG.WindowFramework.Editor.WindowFrameControllerEditor.EditorThemePath = "WindowFramework/Themes/WFW-EditorTheme/WFW-EditorTheme"
staticprivate