Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.WindowFrameThemeData Class Reference

Represents a theme data asset for configuring and managing window frame themes in the Window Framework system. This class is a ScriptableObject that provides functionality for managing themes, tracking the active theme, and applying changes to the window frame styles. More...

Inheritance diagram for GWG.WindowFramework.WindowFrameThemeData:
Collaboration diagram for GWG.WindowFramework.WindowFrameThemeData:

Public Member Functions

void CleanPlayerThemes ()
 Removes entries marked PlayerTheme from the serialized Themes list only.
List< StyleSheet > ComposeStyleSheets (StyleSheet settings)
 Builds the configured shared-application order followed by one theme settings sheet.
void ConfigureRequiredFrameworkStylesheets (StyleSheet nativeControls, StyleSheet frameworkComponents, StyleSheet slideToggle)
 Records the explicit essential roles after a repository creator has installed its mapped copies.
delegate void DefaultThemeChangedEventHandler (int newThemeIndex)
 Event that is raised when the default theme designation changes.
void EnsureDefaultStyleSheets ()
 Retained legacy stylesheet-copy placeholder for purchaser source compatibility.
void LoadPlayerThemes ()
 Refreshes portable JSON/image discovery through this configuration's initialized controller session.
void RefreshApplicationStyleSheets ()
 Republishes the current composition after an in-place application-list edit.
void SetAsDefaultTheme (int themeIndex)
 Designates a specific theme as the default theme by clearing the default flag from all themes and setting it only on the specified theme index. Triggers the default theme changed event to notify subscribers.
void SetTheme (int newActiveThemeIndex)
 Updates the active theme by setting the specified theme index. If the provided index is invalid or out of range, a default theme index is applied instead. Upon successful update of the active theme, triggers the OnThemeChanged event to notify listeners about the theme change.
void SetToDefaultTheme ()
 Selects the single valid configured default through the existing theme selection path.
delegate void ThemeChangedEventHandler (int newThemeIndex, StyleSheet newStylesheet)
 Event that is raised when the active theme changes.
bool TryGetDefaultThemeIndex (out int index, out string error)
 Resolves exactly one valid configured default without modifying the theme list.
bool TryGetRequiredFrameworkStylesheets (out StyleSheet nativeControls, out StyleSheet frameworkComponents, out StyleSheet slideToggle)
 Returns recorded essential-role references without loading shipped assets or modifying composition.

Data Fields

float defaultContextMenuFadeDelay = 0.75f
 Fallback context-menu delay before fading in seconds.
float defaultContextMenuFadeTime = 0.5f
 Fallback context-menu fade duration in seconds.
bool defaultDockingEnabled = true
 Fallback global gesture docking policy; individual window restrictions still apply.
float defaultSnapDistance = 5f
 Fallback attraction distance, range one through ten window-layout units.
bool defaultSnappingEnabled = true
 Fallback magnetic-snapping enablement when no user preference overrides it.
bool defaultSnapToScreen = true
 Fallback viewport-edge attraction policy, not window docking permission.
bool defaultSnapToWindows = true
 Fallback neighboring-window attraction policy.
bool defaultTabDockingEnabled = true
 Fallback global gesture tab policy; not a replacement for AllowTabDocking.
float defaultTooltipFadeDelay = 0.75f
 Fallback tooltip hide delay in seconds.
float defaultTooltipFadeTime = 0.5f
 Fallback tooltip fade duration in seconds.
TooltipFadeType defaultTooltipFadeType = TooltipFadeType.FadeInAndOut
 Fallback tooltip fade mode; this is operational policy, not a stylesheet value.
bool defaultTooltipsEnabled = true
 Fallback framework-tooltip enablement when no user preference exists.
float defaultTooltipShowDelay = 2f
 Fallback tooltip appearance delay in seconds.

Static Public Attributes

const string ContextMenuFadeDelayKey = "WFW_CONTEXTMENU_FADEDELAY"
 PlayerPrefs key for context-menu delay before fade, in seconds.
const string ContextMenuFadeTimeKey = "WFW_CONTEXTMENU_FADETIME"
 PlayerPrefs key for context-menu fade duration in seconds.
const float DoubleClickMaxDelay = 0.35f
 Maximum interval in seconds for the configured double-click gesture.
const float DoubleClickMaxDistance = 6f
 Maximum pointer distance for the configured double-click gesture.
const string TooltipFadeDelayKey = "WFW_TOOLTIP_FADEDELAY"
 PlayerPrefs key for tooltip delay before fade, in seconds.
const string TooltipFadeTimeKey = "WFW_TOOLTIP_FADETIME"
 PlayerPrefs key for tooltip fade duration in seconds.
const string TooltipFadeTypeKey = "WFW_TOOLTIP_FADETYPE"
 PlayerPrefs integer key storing TooltipFadeType.
const string TooltipsEnabledKey = "WFW_TOOLTIPS_ENABLED"
 PlayerPrefs string-boolean key for framework tooltip enablement.
const string TooltipShowDelayKey = "WFW_TOOLTIP_SHOWDELAY"
 PlayerPrefs key storing tooltip appearance delay; consumer accessors document units.
const string WindowDockingEnabledKey = "WFW_WINDOW_DOCKING_ENABLED"
 Integer-boolean preference key enabling pointer-driven screen docking.
const string WindowSnapDistanceKey = "WFW_WINDOW_SNAP_DISTANCE"
 Float preference key for magnetic distance in window-layout units.
const float WindowSnapDistanceMax = 10f
 Maximum configured snap-distance value used by settings validation.
const float WindowSnapDistanceMin = 1f
 Minimum configured snap-distance value used by settings validation.
const string WindowSnappingEnabledKey = "WFW_WINDOW_SNAPPING_ENABLED"
 Integer-boolean preference key for magnetic attraction.
const string WindowSnapToScreenKey = "WFW_WINDOW_SNAP_TO_SCREEN"
 Integer-boolean preference key enabling viewport-edge snapping.
const string WindowSnapToWindowsKey = "WFW_WINDOW_SNAP_TO_WINDOWS"
 Integer-boolean preference key enabling neighboring-window attraction.
const string WindowTabDockingEnabledKey = "WFW_WINDOW_TAB_DOCKING_ENABLED"
 Integer-boolean preference key enabling pointer-driven tab docking.

Protected Member Functions

virtual void OnPropertyChanged ([CallerMemberName] string propertyName=null)
 Raises the PropertyChanged event for the specified property and triggers editor view repaints.
bool SetField< T > (ref T field, T value, Action< T > onFieldChanged=null, [CallerMemberName] string propertyName=null)
 Assigns a changed value and publishes binding/property notifications in order.

Properties

int ActiveThemeIndex [get, set]
 Represents the index of the currently active theme within the list of available themes. This property is used to determine which theme's stylesheet is applied to the window frame. When set, it validates the provided index to ensure it falls within the valid range of the theme list. Changes to this property trigger notifications to reflect updates in the theme selection.
List< StyleSheet > ApplicationStyleSheets [get, set]
 Gets or sets the collection's ordered shared application stylesheets.
StyleSheet CurrentStylesheet [get]
 Gets the current active stylesheet based on the selected theme in the theme list. This property dynamically determines which theme's StyleSheet should be returned by evaluating the active theme index and ensuring it points to a valid theme. If the active theme index is invalid or out of range, it will attempt to find a default theme or set the first theme in the list as the default. Returns null if no themes are available.
GWG.WindowFramework.Theming.PlayerThemeRuntime PlayerThemes [get, private set]
 Gets the controller-owned live player catalog/selection session, never serialized into this asset.
bool PlayerThemesEnabled [get, set]
 Enables bounded JSON/image player themes; no player stylesheet content is executed.
string PlayerThemesFolderName [get, set]
 Gets or sets the single child folder under the application's persistent data path.
ThemeApplyMethods ThemeApplyMethod [get, set]
 Defines the method used to apply themes in the window framework. Determines the scope of the theme application, ranging from targeting only window frames to applying the theme to broader groups such as parent panels or all active panels in the scene.
List< WindowFrameTheme > Themes [get, set]
 Represents a collection of themes used to manage and apply different stylesheets for the window framework. This list enables dynamic switching between themes at runtime and provides a structured way to handle theme data in the inspector.

Events

DefaultThemeChangedEventHandler OnDefaultThemeChanged
 Notifies default designation changes independently of active selection.
Action OnPlayerThemesChanged
 Raised when the controller attaches or releases its runtime session.
ThemeChangedEventHandler OnThemeChanged
 Publishes selected sheet or refreshed composition; subscribers remove their own handlers.
PropertyChangedEventHandler PropertyChanged
 Event required by INotifyPropertyChanged interface for property change notifications. Used for editor integration and real-time property updates.
EventHandler< BindablePropertyChangedEventArgs > propertyChanged
 Unity binding change notification emitted by SetField for its reported property.

Private Member Functions

long IDataSourceViewHashProvider. GetViewHashCode ()
void IncrementVersion ()
void OnValidate ()

Private Attributes

int _activeThemeIndex = -1
List< StyleSheet > _applicationStyleSheets = new List<StyleSheet>()
StyleSheet _requiredFrameworkComponents
StyleSheet _requiredNativeControls
StyleSheet _requiredSlideToggle
ThemeApplyMethods _themeApplyMethod = ThemeApplyMethods.WindowsFramesOnly
List< WindowFrameTheme > _themes = new List<WindowFrameTheme>()
int _version
string playerThemesFolderName = "WindowFrameworkThemes"

Detailed Description

Represents a theme data asset for configuring and managing window frame themes in the Window Framework system. This class is a ScriptableObject that provides functionality for managing themes, tracking the active theme, and applying changes to the window frame styles.

The WindowFrameThemeData class serves as the central hub for theme management within the Window Framework. It handles theme loading, validation, switching, and application across different scopes of the user interface.

KeyValue Features:

  • Dynamic theme switching at runtime
  • Automatic default theme handling and validation
  • Event-driven theme change notifications
  • Configurable theme application methods
  • Built-in default theme fallback system
  • Future support for player-created themes

This class includes the ability to load and manage themes bundled with the application. It also provides methods to apply themes and invoke changes when the active theme is updated.

Integration:
This class implements INotifyPropertyChanged for editor integration and real-time property updates, making it suitable for both runtime and editor-time theme management scenarios.

// Create a new theme data asset
var themeData = ScriptableObject.CreateInstance<WindowFrameThemeData>();
// Add a custom theme
var customTheme = new WindowFrameTheme
{
name = "Dark Theme",
themeStyleSheet = darkThemeStyleSheet,
isDefault = false
};
themeData.Themes.Add(customTheme);
// Set theme application method
themeData.ThemeApplyMethod = ThemeApplyMethods.WindowsFramesOnly;
// Switch to a different theme
themeData.SetTheme(1);
// Listen for theme changes
themeData.OnThemeChanged += (index, stylesheet) =>
{
Debug.Log($"Theme changed to index {index}");
ApplyThemeToUI(stylesheet);
};
Represents a theme data asset for configuring and managing window frame themes in the Window Framewor...
Definition WindowFrameThemeData.cs:141
Represents an individual theme definition within the Window Framework. Encapsulates theme metadata,...
Definition WindowFrameTheme.cs:17
ThemeApplyMethods
Specifies the method used to apply themes within the window framework system. Determines the level or...
Definition WindowFrameThemeData.cs:67

Member Function Documentation

◆ CleanPlayerThemes()

void GWG.WindowFramework.WindowFrameThemeData.CleanPlayerThemes ( )
inline

Removes entries marked PlayerTheme from the serialized Themes list only.

This legacy-list cleanup does not dispose or clear the controller's portable catalog, remove player files, initialize discovery or validate remaining default/indices. Current portable entries belong to PlayerThemes.Catalog and are not appended here. Requires a nonnull list and entries. Do not call as a substitute for session refresh/disposal.

Here is the caller graph for this function:

◆ ComposeStyleSheets()

List< StyleSheet > GWG.WindowFramework.WindowFrameThemeData.ComposeStyleSheets ( StyleSheet settings)
inline

Builds the configured shared-application order followed by one theme settings sheet.

Parameters
settingsSelected theme settings sheet; null leaves only application sheets.
Returns
A new list of borrowed references, with no duplicate entries.

For a theme using collection application sheets, preserves the authored shared list order, skips nulls/duplicates/the settings reference, and appends the selected settings once. A matching legacy self-contained theme that opts out of collection sheets returns only its settings sheet. This method does not discover or load another theme, mutate configuration, install sheets on UI, write dimensions or apply portable player overrides. The controller's BuildSheetList adds its optional distinct global sheet at the configured first/last position; HandleThemeChanged installs that result at the configured panel/window scope. Theme selection or RefreshApplicationStyleSheets publishes the existing OnThemeChanged notification; layout calculation and the ordinary window's saved-state/reveal sequence remain separate.

Here is the caller graph for this function:

◆ ConfigureRequiredFrameworkStylesheets()

void GWG.WindowFramework.WindowFrameThemeData.ConfigureRequiredFrameworkStylesheets ( StyleSheet nativeControls,
StyleSheet frameworkComponents,
StyleSheet slideToggle )
inline

Records the explicit essential roles after a repository creator has installed its mapped copies.

Parameters
nativeControlsRepository-owned native-control application sheet.
frameworkComponentsRepository-owned framework component sheet and its imports.
slideToggleRepository-owned slide-toggle application sheet.

Requires the existing composition to begin with these distinct references in standard order. Does not rearrange the list, select themes, save assets or change the player manifest schema. The editor caller must supply mapped destination assets and explicitly persist its copied ThemeData. These references are constraints for authoring UI, not duplicate runtime stylesheet values.

Here is the caller graph for this function:

◆ DefaultThemeChangedEventHandler()

delegate void GWG.WindowFramework.WindowFrameThemeData.DefaultThemeChangedEventHandler ( int newThemeIndex)

Event that is raised when the default theme designation changes.

This event is triggered when a different theme is designated as the default theme. It's separate from the main theme change event because default theme changes may not necessarily change the currently active theme.

// Subscribe to default theme change events
themeData.OnDefaultThemeChanged += (newDefaultIndex) =>
{
Debug.Log($"Default theme changed to: {themeData.Themes[newDefaultIndex].name}");
// Update UI to show new default
UpdateDefaultThemeIndicator(newDefaultIndex);
};

Signature for default-entry authoring notifications.

Parameters
newThemeIndexRequested shipped default index; caller validates before mutation.

◆ EnsureDefaultStyleSheets()

void GWG.WindowFramework.WindowFrameThemeData.EnsureDefaultStyleSheets ( )
inline

Retained legacy stylesheet-copy placeholder for purchaser source compatibility.

This method previously had no usable runtime stylesheet source and was normally disabled. It now intentionally performs no filesystem writes, exports, selection changes or resource acquisition. Loose player USS/TSS files are not executable portable themes. Creating a portable copy requires a complete effective snapshot and the explicit validated PlayerThemeExporter.TryCreate workflow; refreshing existing JSON/image themes uses LoadPlayerThemes after controller initialization. Existing calls remain compilable and do not throw. Deprecation is warning-only in version 2.0.0; any future removal requires a separately announced breaking release and migration documentation.

// Legacy purchaser code still compiles; no files are written by this placeholder.
themeData.EnsureDefaultStyleSheets();

◆ GetViewHashCode()

long IDataSourceViewHashProvider. GWG.WindowFramework.WindowFrameThemeData.GetViewHashCode ( )
inlineprivate

◆ IncrementVersion()

void GWG.WindowFramework.WindowFrameThemeData.IncrementVersion ( )
inlineprivate
Here is the caller graph for this function:

◆ LoadPlayerThemes()

void GWG.WindowFramework.WindowFrameThemeData.LoadPlayerThemes ( )
inline

Refreshes portable JSON/image discovery through this configuration's initialized controller session.

Disabled player imports return immediately. Requires WindowFrameController.Instance to own this exact theme-data asset and an initialized PlayerThemes session; otherwise throws InvalidOperationException. Refresh failures log their bounded report and retain the prior catalog according to the session contract. No loose USS/TSS is executed and no imported entries are appended to the serialized shipped Themes list. This is discovery, not export.

// After the configured controller's player session is initialized:
themeData.LoadPlayerThemes();
// Inspect themeData.PlayerThemes.Catalog and ActiveId, not Themes.Count for player entries.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnPropertyChanged()

virtual void GWG.WindowFramework.WindowFrameThemeData.OnPropertyChanged ( [CallerMemberName] string propertyName = null)
inlineprotectedvirtual

Raises the PropertyChanged event for the specified property and triggers editor view repaints.

Parameters
propertyNameThe name of the property that changed. Automatically determined if not provided using CallerMemberName attribute.

This method triggers editor view repaints when properties change, ensuring that Inspector windows and other editor UI elements reflect current property values.

// Typically called from property setters (automatically):
public int SomeProperty
{
get { return _someProperty; }
set
{
if (_someProperty != value)
{
_someProperty = value;
OnPropertyChanged(); // Property name automatically detected
}
}
}
// Manual call with explicit property name:
int ActiveThemeIndex
Represents the index of the currently active theme within the list of available themes....
Definition WindowFrameThemeData.cs:671
virtual void OnPropertyChanged([CallerMemberName] string propertyName=null)
Raises the PropertyChanged event for the specified property and triggers editor view repaints.
Definition WindowFrameThemeData.cs:962
Here is the caller graph for this function:

◆ OnValidate()

void GWG.WindowFramework.WindowFrameThemeData.OnValidate ( )
inlineprivate
Here is the call graph for this function:

◆ RefreshApplicationStyleSheets()

void GWG.WindowFramework.WindowFrameThemeData.RefreshApplicationStyleSheets ( )
inline

Republishes the current composition after an in-place application-list edit.

Does not select another theme or change persistence. Call after modifying the returned list directly; assigning ApplicationStyleSheets invokes this automatically.

Here is the caller graph for this function:

◆ SetAsDefaultTheme()

void GWG.WindowFramework.WindowFrameThemeData.SetAsDefaultTheme ( int themeIndex)
inline

Designates a specific theme as the default theme by clearing the default flag from all themes and setting it only on the specified theme index. Triggers the default theme changed event to notify subscribers.

Parameters
themeIndexThe zero-based index of the theme to set as default.

This method updates the default theme designation by clearing the default flag from all themes and setting it only on the specified theme. This ensures that exactly one theme is marked as default at any time.

// Set the second theme as default
themeData.SetAsDefaultTheme(1);
// Set default theme with validation
int newDefaultIndex = 3;
if (newDefaultIndex >= 0 && newDefaultIndex < themeData.Themes.Count)
{
themeData.SetAsDefaultTheme(newDefaultIndex);
}
// Find and set a theme as default by name
string themeName = "Dark Theme";
int themeIndex = themeData.Themes.FindIndex(t => t.name == themeName);
if (themeIndex >= 0)
{
themeData.SetAsDefaultTheme(themeIndex);
Debug.Log($"Set '{themeName}' as default theme");
}
Here is the caller graph for this function:

◆ SetField< T >()

bool GWG.WindowFramework.WindowFrameThemeData.SetField< T > ( ref T field,
T value,
Action< T > onFieldChanged = null,
[CallerMemberName] string propertyName = null )
inlineprotected

Assigns a changed value and publishes binding/property notifications in order.

Template Parameters
TField type compared through EqualityComparer.Default.
Parameters
fieldBacking storage to update.
valueRequested new value.
onFieldChangedOptional synchronous callback after binding notification.
propertyNameReported property name, inferred from caller when omitted.
Returns
False when equal; true after assignment, notifications and view-version increment.

No asset/file save or domain validation. Throwing listeners can leave the field changed before later notifications/version increment; this is not an atomic transaction.

Here is the call graph for this function:

◆ SetTheme()

void GWG.WindowFramework.WindowFrameThemeData.SetTheme ( int newActiveThemeIndex)
inline

Updates the active theme by setting the specified theme index. If the provided index is invalid or out of range, a default theme index is applied instead. Upon successful update of the active theme, triggers the OnThemeChanged event to notify listeners about the theme change.

Parameters
newActiveThemeIndexThe index of the theme to be set as active.

This method is the primary way to switch themes in the window framework. It performs validation on the provided index and updates the active theme accordingly. If the index is invalid, it falls back to the first theme (index 0).

Event Notification:
Upon successful theme change, the method triggers the OnThemeChanged event with the new theme index and associated StyleSheet, allowing subscribers to update their UI elements accordingly.

// Switch to a specific theme by index
themeData.SetTheme(2);
// Switch themes with validation
int desiredTheme = 4;
if (desiredTheme < themeData.Themes.Count)
{
themeData.SetTheme(desiredTheme);
Debug.Log($"Switched to theme: {themeData.Themes[desiredTheme].name}");
}
// Cycle through themes
int nextTheme = (themeData.ActiveThemeIndex + 1) % themeData.Themes.Count;
themeData.SetTheme(nextTheme);
// Switch to theme by name
string targetTheme = "Dark Mode";
int themeIndex = themeData.Themes.FindIndex(t => t.name == targetTheme);
if (themeIndex >= 0)
{
themeData.SetTheme(themeIndex);
Debug.Log($"Switched to theme: {targetTheme}");
}
// Handle theme selection from UI dropdown
private void OnThemeDropdownChanged(int selectedIndex)
{
themeData.SetTheme(selectedIndex);
// Save user preference
PlayerPrefs.SetInt("UserSelectedTheme", selectedIndex);
PlayerPrefs.Save();
}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetToDefaultTheme()

void GWG.WindowFramework.WindowFrameThemeData.SetToDefaultTheme ( )
inline

Selects the single valid configured default through the existing theme selection path.

No missing default is fabricated and index zero is not automatically marked. Missing/multiple defaults or a default without a stylesheet log an error and leave selection unchanged. With an initialized player session, SetTheme routes through stable identity, application and persistence; otherwise it publishes the configured shipped stylesheet. This method does not create assets, discover files or initialize a second runtime session.

if (themeData.TryGetDefaultThemeIndex(out var index, out var error))
themeData.SetToDefaultTheme();
else
UnityEngine.Debug.LogError(error);
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ThemeChangedEventHandler()

delegate void GWG.WindowFramework.WindowFrameThemeData.ThemeChangedEventHandler ( int newThemeIndex,
StyleSheet newStylesheet )

Event that is raised when the active theme changes.

This event provides notification when the active theme is changed, either through direct theme switching or automatic fallback to default themes. Subscribers receive both the new theme index and the associated StyleSheet for immediate application.

// Subscribe to theme change events
themeData.OnThemeChanged += (index, stylesheet) =>
{
Debug.Log($"Theme changed to: {themeData.Themes[index].name}");
// Apply new stylesheet to UI elements
if (stylesheet != null)
{
rootVisualElement.styleSheets.Clear();
rootVisualElement.styleSheets.Add(stylesheet);
}
};
// Unsubscribe when no longer needed
themeData.OnThemeChanged -= OnThemeChangedHandler;

Signature for shipped stylesheet/composition publication.

Parameters
newThemeIndexConfigured shipped-list index, not imported player identity.
newStylesheetBorrowed selected settings sheet; compose through the collection.

◆ TryGetDefaultThemeIndex()

bool GWG.WindowFramework.WindowFrameThemeData.TryGetDefaultThemeIndex ( out int index,
out string error )
inline

Resolves exactly one valid configured default without modifying the theme list.

Parameters
indexConfigured shipped index on success.
errorExplicit configuration problem.
Returns
True for one valid default.
Here is the caller graph for this function:

◆ TryGetRequiredFrameworkStylesheets()

bool GWG.WindowFramework.WindowFrameThemeData.TryGetRequiredFrameworkStylesheets ( out StyleSheet nativeControls,
out StyleSheet frameworkComponents,
out StyleSheet slideToggle )
inline

Returns recorded essential-role references without loading shipped assets or modifying composition.

Copied repositories retain their own object identities even if their files are renamed/moved. Older collections may have no recorded roles; callers must report that, not guess by filename/order. The canonical shipped collection can be resolved separately by editor-side known asset references.

Here is the caller graph for this function:

Field Documentation

◆ _activeThemeIndex

int GWG.WindowFramework.WindowFrameThemeData._activeThemeIndex = -1
private

◆ _applicationStyleSheets

List<StyleSheet> GWG.WindowFramework.WindowFrameThemeData._applicationStyleSheets = new List<StyleSheet>()
private

◆ _requiredFrameworkComponents

StyleSheet GWG.WindowFramework.WindowFrameThemeData._requiredFrameworkComponents
private

◆ _requiredNativeControls

StyleSheet GWG.WindowFramework.WindowFrameThemeData._requiredNativeControls
private

◆ _requiredSlideToggle

StyleSheet GWG.WindowFramework.WindowFrameThemeData._requiredSlideToggle
private

◆ _themeApplyMethod

ThemeApplyMethods GWG.WindowFramework.WindowFrameThemeData._themeApplyMethod = ThemeApplyMethods.WindowsFramesOnly
private

◆ _themes

List<WindowFrameTheme> GWG.WindowFramework.WindowFrameThemeData._themes = new List<WindowFrameTheme>()
private

◆ _version

int GWG.WindowFramework.WindowFrameThemeData._version
private

◆ ContextMenuFadeDelayKey

const string GWG.WindowFramework.WindowFrameThemeData.ContextMenuFadeDelayKey = "WFW_CONTEXTMENU_FADEDELAY"
static

PlayerPrefs key for context-menu delay before fade, in seconds.

◆ ContextMenuFadeTimeKey

const string GWG.WindowFramework.WindowFrameThemeData.ContextMenuFadeTimeKey = "WFW_CONTEXTMENU_FADETIME"
static

PlayerPrefs key for context-menu fade duration in seconds.

◆ defaultContextMenuFadeDelay

float GWG.WindowFramework.WindowFrameThemeData.defaultContextMenuFadeDelay = 0.75f

Fallback context-menu delay before fading in seconds.

◆ defaultContextMenuFadeTime

float GWG.WindowFramework.WindowFrameThemeData.defaultContextMenuFadeTime = 0.5f

Fallback context-menu fade duration in seconds.

◆ defaultDockingEnabled

bool GWG.WindowFramework.WindowFrameThemeData.defaultDockingEnabled = true

Fallback global gesture docking policy; individual window restrictions still apply.

◆ defaultSnapDistance

float GWG.WindowFramework.WindowFrameThemeData.defaultSnapDistance = 5f

Fallback attraction distance, range one through ten window-layout units.

◆ defaultSnappingEnabled

bool GWG.WindowFramework.WindowFrameThemeData.defaultSnappingEnabled = true

Fallback magnetic-snapping enablement when no user preference overrides it.

◆ defaultSnapToScreen

bool GWG.WindowFramework.WindowFrameThemeData.defaultSnapToScreen = true

Fallback viewport-edge attraction policy, not window docking permission.

◆ defaultSnapToWindows

bool GWG.WindowFramework.WindowFrameThemeData.defaultSnapToWindows = true

Fallback neighboring-window attraction policy.

◆ defaultTabDockingEnabled

bool GWG.WindowFramework.WindowFrameThemeData.defaultTabDockingEnabled = true

Fallback global gesture tab policy; not a replacement for AllowTabDocking.

◆ defaultTooltipFadeDelay

float GWG.WindowFramework.WindowFrameThemeData.defaultTooltipFadeDelay = 0.75f

Fallback tooltip hide delay in seconds.

◆ defaultTooltipFadeTime

float GWG.WindowFramework.WindowFrameThemeData.defaultTooltipFadeTime = 0.5f

Fallback tooltip fade duration in seconds.

◆ defaultTooltipFadeType

TooltipFadeType GWG.WindowFramework.WindowFrameThemeData.defaultTooltipFadeType = TooltipFadeType.FadeInAndOut

Fallback tooltip fade mode; this is operational policy, not a stylesheet value.

◆ defaultTooltipsEnabled

bool GWG.WindowFramework.WindowFrameThemeData.defaultTooltipsEnabled = true

Fallback framework-tooltip enablement when no user preference exists.

◆ defaultTooltipShowDelay

float GWG.WindowFramework.WindowFrameThemeData.defaultTooltipShowDelay = 2f

Fallback tooltip appearance delay in seconds.

◆ DoubleClickMaxDelay

const float GWG.WindowFramework.WindowFrameThemeData.DoubleClickMaxDelay = 0.35f
static

Maximum interval in seconds for the configured double-click gesture.

◆ DoubleClickMaxDistance

const float GWG.WindowFramework.WindowFrameThemeData.DoubleClickMaxDistance = 6f
static

Maximum pointer distance for the configured double-click gesture.

◆ playerThemesFolderName

string GWG.WindowFramework.WindowFrameThemeData.playerThemesFolderName = "WindowFrameworkThemes"
private

◆ TooltipFadeDelayKey

const string GWG.WindowFramework.WindowFrameThemeData.TooltipFadeDelayKey = "WFW_TOOLTIP_FADEDELAY"
static

PlayerPrefs key for tooltip delay before fade, in seconds.

◆ TooltipFadeTimeKey

const string GWG.WindowFramework.WindowFrameThemeData.TooltipFadeTimeKey = "WFW_TOOLTIP_FADETIME"
static

PlayerPrefs key for tooltip fade duration in seconds.

◆ TooltipFadeTypeKey

const string GWG.WindowFramework.WindowFrameThemeData.TooltipFadeTypeKey = "WFW_TOOLTIP_FADETYPE"
static

PlayerPrefs integer key storing TooltipFadeType.

◆ TooltipsEnabledKey

const string GWG.WindowFramework.WindowFrameThemeData.TooltipsEnabledKey = "WFW_TOOLTIPS_ENABLED"
static

PlayerPrefs string-boolean key for framework tooltip enablement.

◆ TooltipShowDelayKey

const string GWG.WindowFramework.WindowFrameThemeData.TooltipShowDelayKey = "WFW_TOOLTIP_SHOWDELAY"
static

PlayerPrefs key storing tooltip appearance delay; consumer accessors document units.

◆ WindowDockingEnabledKey

const string GWG.WindowFramework.WindowFrameThemeData.WindowDockingEnabledKey = "WFW_WINDOW_DOCKING_ENABLED"
static

Integer-boolean preference key enabling pointer-driven screen docking.

◆ WindowSnapDistanceKey

const string GWG.WindowFramework.WindowFrameThemeData.WindowSnapDistanceKey = "WFW_WINDOW_SNAP_DISTANCE"
static

Float preference key for magnetic distance in window-layout units.

◆ WindowSnapDistanceMax

const float GWG.WindowFramework.WindowFrameThemeData.WindowSnapDistanceMax = 10f
static

Maximum configured snap-distance value used by settings validation.

◆ WindowSnapDistanceMin

const float GWG.WindowFramework.WindowFrameThemeData.WindowSnapDistanceMin = 1f
static

Minimum configured snap-distance value used by settings validation.

◆ WindowSnappingEnabledKey

const string GWG.WindowFramework.WindowFrameThemeData.WindowSnappingEnabledKey = "WFW_WINDOW_SNAPPING_ENABLED"
static

Integer-boolean preference key for magnetic attraction.

◆ WindowSnapToScreenKey

const string GWG.WindowFramework.WindowFrameThemeData.WindowSnapToScreenKey = "WFW_WINDOW_SNAP_TO_SCREEN"
static

Integer-boolean preference key enabling viewport-edge snapping.

◆ WindowSnapToWindowsKey

const string GWG.WindowFramework.WindowFrameThemeData.WindowSnapToWindowsKey = "WFW_WINDOW_SNAP_TO_WINDOWS"
static

Integer-boolean preference key enabling neighboring-window attraction.

◆ WindowTabDockingEnabledKey

const string GWG.WindowFramework.WindowFrameThemeData.WindowTabDockingEnabledKey = "WFW_WINDOW_TAB_DOCKING_ENABLED"
static

Integer-boolean preference key enabling pointer-driven tab docking.

Property Documentation

◆ ActiveThemeIndex

int GWG.WindowFramework.WindowFrameThemeData.ActiveThemeIndex
getset

Represents the index of the currently active theme within the list of available themes. This property is used to determine which theme's stylesheet is applied to the window frame. When set, it validates the provided index to ensure it falls within the valid range of the theme list. Changes to this property trigger notifications to reflect updates in the theme selection.

An integer representing the zero-based index of the active theme. Must be within the valid range of the Themes collection.

This property controls which theme from the Themes collection is currently active and applied to the window framework. The index is automatically validated to ensure it remains within the bounds of the available themes.

// Set active theme by index
themeData.ActiveThemeIndex = 2;
// Get current active theme index
int currentIndex = themeData.ActiveThemeIndex;
Debug.Log($"Current theme index: {currentIndex}");
// Validate index before setting
int desiredIndex = 5;
if (desiredIndex >= 0 && desiredIndex < themeData.Themes.Count)
{
themeData.ActiveThemeIndex = desiredIndex;
}
// Cycle through themes
int nextIndex = (themeData.ActiveThemeIndex + 1) % themeData.Themes.Count;
themeData.ActiveThemeIndex = nextIndex;

◆ ApplicationStyleSheets

List<StyleSheet> GWG.WindowFramework.WindowFrameThemeData.ApplicationStyleSheets
getset

Gets or sets the collection's ordered shared application stylesheets.

These sheets consume theme tokens; each theme's single settings sheet supplies their values. After editing the list in code, assign it through this property to notify bindings. Null entries and duplicate references are ignored during composition.

◆ CurrentStylesheet

StyleSheet GWG.WindowFramework.WindowFrameThemeData.CurrentStylesheet
get

Gets the current active stylesheet based on the selected theme in the theme list. This property dynamically determines which theme's StyleSheet should be returned by evaluating the active theme index and ensuring it points to a valid theme. If the active theme index is invalid or out of range, it will attempt to find a default theme or set the first theme in the list as the default. Returns null if no themes are available.

The StyleSheet of the currently active theme, or null if no themes are available.

This property performs automatic validation and fallback logic to handle invalid configurations. The validation steps include:

  1. Checks if any themes are available in the collection
  2. Validates that the active theme index is within valid bounds
  3. Attempts to find and use a designated default theme if index is invalid
  4. Sets the first theme as default if no default theme exists
  5. Returns null if no themes are available
// Get the current active stylesheet
StyleSheet activeSheet = themeData.CurrentStylesheet;
if (activeSheet != null)
{
// Apply the stylesheet to a visual element
visualElement.styleSheets.Add(activeSheet);
Debug.Log($"Applied theme: {themeData.Themes[themeData.ActiveThemeIndex].name}");
}
else
{
Debug.LogWarning("No active theme available");
}
// Use in conjunction with theme switching
themeData.SetTheme(2);
StyleSheet newSheet = themeData.CurrentStylesheet; // Gets the new theme's stylesheet

◆ PlayerThemes

GWG.WindowFramework.Theming.PlayerThemeRuntime GWG.WindowFramework.WindowFrameThemeData.PlayerThemes
getprivate set

Gets the controller-owned live player catalog/selection session, never serialized into this asset.

◆ PlayerThemesEnabled

bool GWG.WindowFramework.WindowFrameThemeData.PlayerThemesEnabled
getset

Enables bounded JSON/image player themes; no player stylesheet content is executed.

◆ PlayerThemesFolderName

string GWG.WindowFramework.WindowFrameThemeData.PlayerThemesFolderName
getset

Gets or sets the single child folder under the application's persistent data path.

◆ ThemeApplyMethod

ThemeApplyMethods GWG.WindowFramework.WindowFrameThemeData.ThemeApplyMethod
getset

Defines the method used to apply themes in the window framework. Determines the scope of the theme application, ranging from targeting only window frames to applying the theme to broader groups such as parent panels or all active panels in the scene.

A ThemeApplyMethods enumeration value that determines the scope of theme application within the UI hierarchy.

This property controls how broadly themes are applied throughout the user interface. The selection affects both performance and visual consistency of theme changes.

Performance Impact:
Broader application methods require more processing time during theme switches. Choose the most restrictive method that meets your visual requirements.

// Set theme application to window frames only (most efficient)
themeData.ThemeApplyMethod = ThemeApplyMethods.WindowsFramesOnly;
// Apply to parent panel for broader coverage
themeData.ThemeApplyMethod = ThemeApplyMethods.ParentPanel;
// Dynamic selection based on performance requirements
if (QualitySettings.GetQualityLevel() >= 3)
{
themeData.ThemeApplyMethod = ThemeApplyMethods.AllPanels;
}
else
{
themeData.ThemeApplyMethod = ThemeApplyMethods.WindowsFramesOnly;
}

◆ Themes

List<WindowFrameTheme> GWG.WindowFramework.WindowFrameThemeData.Themes
getset

Represents a collection of themes used to manage and apply different stylesheets for the window framework. This list enables dynamic switching between themes at runtime and provides a structured way to handle theme data in the inspector.

A List<T> of WindowFrameTheme objects representing all available themes that can be applied to the window framework.

This collection serves as the central repository for all theme configurations within the window framework. It supports dynamic modification at runtime and provides the foundation for theme switching functionality.

Collection Integrity:
The framework ensures that at least one theme is always available and that exactly one theme is designated as the default theme. Invalid configurations are automatically corrected during initialization.

// Add a new theme to the collection
var newTheme = new WindowFrameTheme
{
name = "Custom Dark Theme",
themeStyleSheet = customStyleSheet,
isDefault = false
};
themeData.Themes.Add(newTheme);
// Find a specific theme
var darkTheme = themeData.Themes.Find(t => t.name.Contains("Dark"));
if (darkTheme != null)
{
Debug.Log($"Found dark theme: {darkTheme.name}");
}
// Iterate through all themes
for (int i = 0; i < themeData.Themes.Count; i++)
{
var theme = themeData.Themes[i];
Debug.Log($"Theme {i}: {theme.name} (Default: {theme.isDefault})");
}

Event Documentation

◆ OnDefaultThemeChanged

DefaultThemeChangedEventHandler GWG.WindowFramework.WindowFrameThemeData.OnDefaultThemeChanged

Notifies default designation changes independently of active selection.

Current SetAsDefaultTheme emits inside its loop; one request can raise several notifications. Handler lifetime belongs to subscribers; event does not save the asset.

◆ OnPlayerThemesChanged

Action GWG.WindowFramework.WindowFrameThemeData.OnPlayerThemesChanged

Raised when the controller attaches or releases its runtime session.

◆ OnThemeChanged

ThemeChangedEventHandler GWG.WindowFramework.WindowFrameThemeData.OnThemeChanged

Publishes selected sheet or refreshed composition; subscribers remove their own handlers.

Can fire on application-list refresh without a different selection. Not transition completion.

◆ PropertyChanged

PropertyChangedEventHandler GWG.WindowFramework.WindowFrameThemeData.PropertyChanged

Event required by INotifyPropertyChanged interface for property change notifications. Used for editor integration and real-time property updates.

This event enables automatic UI updates in the Unity Editor when properties change, providing immediate visual feedback during theme configuration and development.

// Subscribe to property changes (typically done by editor systems)
themeData.PropertyChanged += (sender, args) =>
{
Debug.Log($"Property '{args.PropertyName}' changed on {sender}");
};

◆ propertyChanged

EventHandler<BindablePropertyChangedEventArgs> GWG.WindowFramework.WindowFrameThemeData.propertyChanged

Unity binding change notification emitted by SetField for its reported property.

Subscriber owns lifecycle; direct list/entry mutations do not automatically emit it.