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

Represents the configuration and runtime data for the Window Framework system, enabling management of UI-related settings such as tooltips, context menus, and theme preferences. More...

Public Member Functions

void FromDictionary (Dictionary< string, WindowFrameData > dict)
Dictionary< string, WindowFrameDataToDictionary ()

Public Attributes

int ActiveThemeIndex
 Gets or sets the index of the currently active theme in the window framework's theme system.
float ContentMenuDelay
 Gets or sets the delay (in seconds) before context menus begin to fade out after being triggered for dismissal.
float ContentMenuFadeTime
 Gets or sets the duration (in seconds) for context menu fade animations.
bool TooltipActive
 Gets or sets a value indicating whether the tooltip system is enabled and active.
float TooltipFadeTime
 Gets or sets the duration (in seconds) for tooltip fade animations.
TooltipFadeType TooltipFadeType
 Gets or sets the type of fade animation used for tooltip transitions.
float TooltipHideDelay
 Gets or sets the delay (in seconds) before tooltips begin to hide after the cursor leaves the target element.
float TooltipShowDelay
 Gets or sets the delay (in seconds) before tooltips appear after the cursor hovers over a target element.
List< WindowFrameDataEntryWindowFrameDataList = new List<WindowFrameDataEntry>()
 Gets or sets the collection of window frame data entries containing all window configurations and states.
bool WindowMemoryEnabled
 Gets or sets a value indicating whether window memory and persistence features are enabled.

Detailed Description

The WindowFrameworkData class serves as the central configuration hub for the entire window framework system. It contains all global settings that affect the behavior and appearance of windows, tooltips, context menus, and other UI elements within the framework.

Primary Responsibilities:

  • Managing global animation and timing settings for UI elements
  • Storing tooltip configuration and behavior parameters
  • Maintaining context menu appearance and timing settings
  • Handling theme management and active theme selection
  • Controlling window memory and persistence features
  • Providing centralized storage for all window frame data

Serialization and Persistence:
This class is designed to be easily serialized for saving and loading framework configuration between application sessions. The window frame data is stored as a list of entries rather than a dictionary to ensure compatibility with Unity's JSON serialization system.

// Create and configure window framework data
var frameworkData = new WindowFrameworkData
{
TooltipActive = true,
};
// Serialize for saving
string json = JsonUtility.ToJson(frameworkData, true);
Represents the configuration and runtime data for the Window Framework system, enabling management of...
Definition WindowFrameworkData.cs:54
int ActiveThemeIndex
Gets or sets the index of the currently active theme in the window framework's theme system.
Definition WindowFrameworkData.cs:238
bool WindowMemoryEnabled
Gets or sets a value indicating whether window memory and persistence features are enabled.
Definition WindowFrameworkData.cs:261
float TooltipFadeTime
Gets or sets the duration (in seconds) for tooltip fade animations.
Definition WindowFrameworkData.cs:122
float TooltipShowDelay
Gets or sets the delay (in seconds) before tooltips appear after the cursor hovers over a target elem...
Definition WindowFrameworkData.cs:145
bool TooltipActive
Gets or sets a value indicating whether the tooltip system is enabled and active.
Definition WindowFrameworkData.cs:215
float ContentMenuFadeTime
Gets or sets the duration (in seconds) for context menu fade animations.
Definition WindowFrameworkData.cs:76

Member Function Documentation

◆ FromDictionary()

void GWG.WindowFramework.WindowFrameworkData.FromDictionary ( Dictionary< string, WindowFrameData > dict)

◆ ToDictionary()

Dictionary< string, WindowFrameData > GWG.WindowFramework.WindowFrameworkData.ToDictionary ( )

Member Data Documentation

◆ ActiveThemeIndex

int GWG.WindowFramework.WindowFrameworkData.ActiveThemeIndex

An integer representing the zero-based index of the active theme. Must be a valid index within the available themes collection.

This property controls which visual theme is applied to all windows and UI elements within the framework. Themes typically include color schemes, fonts, spacing, and other visual styling properties that provide consistent appearance across the application.

// Set to default theme
frameworkData.ActiveThemeIndex = 0;
// Set to dark theme (assuming it's at index 1)
frameworkData.ActiveThemeIndex = 1;

◆ ContentMenuDelay

float GWG.WindowFramework.WindowFrameworkData.ContentMenuDelay

A float value representing the delay in seconds before context menu fade-out begins. Typical values range from 0.0f to 3.0f seconds.

This delay provides users with a grace period to move their cursor back to the context menu if they accidentally move away from it. It prevents menus from disappearing too quickly when users are trying to navigate to menu items.

// Responsive context menus with short delay
frameworkData.ContentMenuDelay = 0.2f;
// User-friendly context menus with medium delay
frameworkData.ContentMenuDelay = 0.8f;

◆ ContentMenuFadeTime

float GWG.WindowFramework.WindowFrameworkData.ContentMenuFadeTime

A float value representing the time in seconds for context menu fade transitions. Typical values range from 0.1f to 1.0f seconds.

This property controls how long context menus take to fade in when appearing and fade out when disappearing. A shorter duration creates snappy, responsive menus, while a longer duration provides smoother, more polished transitions.

// Quick, responsive context menus
frameworkData.ContentMenuFadeTime = 0.15f;
// Smooth, polished context menus
frameworkData.ContentMenuFadeTime = 0.4f;

◆ TooltipActive

bool GWG.WindowFramework.WindowFrameworkData.TooltipActive

true if tooltips are enabled and will be displayed when appropriate; false if the tooltip system is disabled and no tooltips will appear.

This global switch allows for complete enabling or disabling of the tooltip system throughout the entire window framework. When disabled, no tooltips will be processed or displayed, regardless of individual element tooltip configurations.

// Enable tooltips for desktop application
frameworkData.TooltipActive = true;
// Disable tooltips for touch-based interface
frameworkData.TooltipActive = false;

◆ TooltipFadeTime

float GWG.WindowFramework.WindowFrameworkData.TooltipFadeTime

A float value representing the time in seconds for tooltip fade transitions. Typical values range from 0.1f to 0.8f seconds.

This property determines how quickly tooltips fade in when appearing and fade out when disappearing. The fade time affects the perceived responsiveness and polish of the interface. The fade behavior is controlled by the TooltipFadeType property.

// Quick, subtle tooltip transitions
frameworkData.TooltipFadeTime = 0.2f;
// Smooth, noticeable tooltip transitions
frameworkData.TooltipFadeTime = 0.4f;

◆ TooltipFadeType

TooltipFadeType GWG.WindowFramework.WindowFrameworkData.TooltipFadeType

A TooltipFadeType enumeration value that specifies the animation type for tooltip appearance and disappearance effects.

This property determines the visual style of tooltip animations. Different fade types may be more appropriate for different tooltip styles and content types. The fade type works in conjunction with TooltipFadeTime to create the complete animation effect.

// Simple opacity fade
frameworkData.TooltipFadeType = TooltipFadeType.Opacity;
// Dynamic scale animation
frameworkData.TooltipFadeType = TooltipFadeType.Scale;
TooltipFadeType TooltipFadeType
Gets or sets the type of fade animation used for tooltip transitions.
Definition WindowFrameworkData.cs:192

◆ TooltipHideDelay

float GWG.WindowFramework.WindowFrameworkData.TooltipHideDelay

A float value representing the delay in seconds before tooltip hiding begins. Typical values range from 0.0f to 1.0f seconds.

This delay provides a grace period that allows users to move their cursor from the trigger element to the tooltip itself (if the tooltip is interactive) or gives users time to finish reading the tooltip content before it disappears.

// No delay for simple tooltips
frameworkData.TooltipHideDelay = 0.0f;
// Longer delay for interactive tooltips
frameworkData.TooltipHideDelay = 0.8f;

◆ TooltipShowDelay

float GWG.WindowFramework.WindowFrameworkData.TooltipShowDelay

A float value representing the hover delay in seconds before tooltip display begins. Typical values range from 0.3f to 2.0f seconds.

This delay prevents tooltips from appearing immediately when the cursor briefly passes over elements, reducing visual noise and distraction. The delay should be long enough to avoid accidental tooltip triggers but short enough to be responsive to intentional hovering.

// Responsive tooltips for interactive elements
frameworkData.TooltipShowDelay = 0.4f;
// Conservative tooltips to reduce distraction
frameworkData.TooltipShowDelay = 1.5f;

◆ WindowFrameDataList

List<WindowFrameDataEntry> GWG.WindowFramework.WindowFrameworkData.WindowFrameDataList = new List<WindowFrameDataEntry>()

A List<T> of WindowFrameDataEntry objects, each containing a key-value pair of window identifiers and their corresponding WindowFrameData.

This list serves as the primary storage for all window frame configurations within the framework. It's implemented as a list of entries rather than a dictionary to ensure compatibility with Unity's JSON serialization system, which doesn't natively support dictionary serialization.

// Add window data to the list
frameworkData.WindowFrameDataList.Add(new WindowFrameDataEntry
{
Key = "MainWindow",
Value = new WindowFrameData
{
windowId = "MainWindow",
title = "Main Window"
}
});
Represents a key-value pair entry for window frame data storage, designed for serialization compatibi...
Definition WindowFrameworkData.cs:332
Represents the serializable data structure for storing and loading window frame configuration and sta...
Definition WindowFrameData.cs:63

◆ WindowMemoryEnabled

bool GWG.WindowFramework.WindowFrameworkData.WindowMemoryEnabled

true if window positions, sizes, and states should be remembered and restored; false if windows should always use their default configurations.

When window memory is enabled, the framework will automatically save and restore window positions, sizes, visibility states, and other window-specific settings between application sessions.

// Enable window memory for desktop applications
frameworkData.WindowMemoryEnabled = true;
// Disable for kiosk applications
frameworkData.WindowMemoryEnabled = false;