mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-13 16:59:38 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
44 lines
911 B
C#
44 lines
911 B
C#
namespace Sandbox.UI;
|
|
|
|
public struct LayoutCascade
|
|
{
|
|
public bool SelectorChanged;
|
|
public bool ParentChanged;
|
|
public bool SkipTransitions;
|
|
|
|
public Styles ParentStyles;
|
|
|
|
internal RootPanel Root;
|
|
|
|
//
|
|
// Cascading Properties
|
|
//
|
|
public float Scale;
|
|
|
|
/// <summary>
|
|
/// Some properties cascade from their parent onto children if the children
|
|
/// don't set them. Things like font size, color, cursor.
|
|
/// </summary>
|
|
internal void ApplyCascading( Styles cached )
|
|
{
|
|
if ( ParentStyles == null )
|
|
return;
|
|
|
|
cached.ApplyCascading( ParentStyles );
|
|
|
|
if ( cached.TextShadow.Count == 0 )
|
|
{
|
|
if ( ParentStyles.TextShadow.Count != 0 )
|
|
cached.TextShadow.AddRange( ParentStyles.TextShadow );
|
|
}
|
|
|
|
if ( cached.TextGradient.ColorOffsets.IsDefaultOrEmpty )
|
|
{
|
|
if ( !ParentStyles.TextGradient.ColorOffsets.IsDefaultOrEmpty )
|
|
{
|
|
cached.TextGradient = ParentStyles.TextGradient;
|
|
}
|
|
}
|
|
}
|
|
}
|