예제 #1
0
 protected override void ApplyStyle(SliderStyleData style)
 {
     StyleUtils.Apply(style, slider);
     StyleUtils.Apply(style.background, background);
     StyleUtils.Apply(style.fill, fill);
     StyleUtils.Apply(style.handle, handle);
 }
예제 #2
0
 protected override void ApplyStyle(InputFieldStyleData style)
 {
     StyleUtils.Apply(style, inputField);
     StyleUtils.Apply(style.background, background);
     StyleUtils.Apply(style.text, text);
     StyleUtils.Apply(style.placeholder, placeholder);
 }
예제 #3
0
 protected override void ApplyStyle(ToggleStyleData style)
 {
     StyleUtils.Apply(style, toggle);
     StyleUtils.Apply(style.background, background);
     StyleUtils.Apply(style.checkmarkBackground, checkmarkBackground);
     StyleUtils.Apply(style.checkmark, checkmark);
     StyleUtils.Apply(style.text, text);
 }
예제 #4
0
        private static bool EnumerateStyle(ElementStyle asset, object overrides, ElementStyle[] inherits,
                                           Func <ElementStyle, object, bool> enumerator)
        {
            var visitedObjectsSet = StyleUtils.GetPooledHashSet();

            try
            {
                bool EnumerateRecursive(ElementStyle innerAsset, object innerOverrides, ElementStyle[] innerInherits)
                {
                    if (!visitedObjectsSet.Add(innerAsset))
                    {
                        return(false);
                    }

                    if (innerOverrides != null && enumerator(innerAsset, innerOverrides))
                    {
                        return(true);
                    }

                    if (innerInherits == null)
                    {
                        return(false);
                    }

                    for (var i = innerInherits.Length - 1; i >= 0; i--)
                    {
                        var style = innerInherits[i];

                        if (!style)
                        {
                            continue;
                        }

                        if (EnumerateRecursive(style, style.Overrides, style.Inherits))
                        {
                            return(true);
                        }
                    }

                    return(false);
                }

                return(EnumerateRecursive(asset, overrides, inherits));
            }
            finally
            {
                StyleUtils.ReturnHashSet(visitedObjectsSet);
            }
        }
예제 #5
0
        protected override void ApplyStyle(ScrollRectStyleData style)
        {
            StyleUtils.Apply(style, scrollView);
            StyleUtils.Apply(style.background, background);

            if (horizontalScrollbar)
            {
                horizontalScrollbar.ApplyStyleFromParent(style.scrollBar);
            }

            if (verticalScrollbar)
            {
                verticalScrollbar.ApplyStyleFromParent(style.scrollBar);
            }
        }
예제 #6
0
        protected override void ApplyStyle(DropdownStyleData style)
        {
            StyleUtils.Apply(style, dropdown);
            StyleUtils.Apply(style.background, background);
            StyleUtils.Apply(style.arrow, arrow);
            StyleUtils.Apply(style.text, text);

            if (dropdownBackground)
            {
                dropdownBackground.ApplyStyleFromParent(style.dropdownBackground);
            }

            if (dropdownItem)
            {
                dropdownItem.ApplyStyleFromParent(style.dropdownItem);
            }
        }
예제 #7
0
 protected override void ApplyStyle(ImageStyleData style)
 {
     StyleUtils.Apply(style, image);
 }
예제 #8
0
 protected override void ApplyStyle(ScrollbarStyleData style)
 {
     StyleUtils.Apply(style, scrollbar);
     StyleUtils.Apply(style.background, background);
     StyleUtils.Apply(style.handle, handle);
 }
예제 #9
0
 protected override void ApplyStyle(ButtonStyleData style)
 {
     StyleUtils.Apply(style, button);
     StyleUtils.Apply(style.background, background);
     StyleUtils.Apply(style.text, text);
 }
예제 #10
0
 protected override void ApplyStyle(TextStyleData style)
 {
     StyleUtils.Apply(style, text);
 }