コード例 #1
0
        //
        // Styles
        //

        public void RefreshStyle(VisualElement documentElement)
        {
            foreach (var openUSS in m_OpenUSSFiles)
            {
                var sheet = openUSS.Sheet;
                if (sheet == null)
                {
                    continue;
                }

                if (!documentElement.styleSheets.Contains(sheet))
                {
                    documentElement.styleSheets.Clear();

                    foreach (var innerOpenUSS in m_OpenUSSFiles)
                    {
                        if (innerOpenUSS.Sheet != null)
                        {
                            documentElement.styleSheets.Add(innerOpenUSS.Sheet);
                        }
                    }

                    break;
                }
            }

            StyleCache.ClearStyleCache();
            UnityEngine.UIElements.StyleSheets.StyleSheetCache.ClearCaches();
            foreach (var openUSS in m_OpenUSSFiles)
            {
                openUSS.FixRuleReferences();
            }
            documentElement.IncrementVersion((VersionChangeType)(-1));
        }
コード例 #2
0
        public void RefreshStyle(VisualElement documentElement)
        {
            if (!documentElement.styleSheets.Contains(mainStyleSheet))
            {
                documentElement.styleSheets.Clear();
                documentElement.styleSheets.Add(mainStyleSheet);
            }

            StyleCache.ClearStyleCache();
            UnityEngine.UIElements.StyleSheets.StyleSheetCache.ClearCaches();
            mainStyleSheet.FixRuleReferences();
            documentElement.IncrementVersion((VersionChangeType)(-1));
        }
コード例 #3
0
        //
        // Styles
        //

        public void RefreshStyle(VisualElement documentRootElement)
        {
            if (m_CurrentDocumentRootElement == null)
            {
                m_CurrentDocumentRootElement = documentRootElement;
            }

            StyleCache.ClearStyleCache();
            UnityEngine.UIElements.StyleSheets.StyleSheetCache.ClearCaches();
            foreach (var openUSS in m_OpenUSSFiles)
            {
                openUSS.FixRuleReferences();
            }
            m_CurrentDocumentRootElement.IncrementVersion((VersionChangeType)(-1));
        }
コード例 #4
0
        public void OnEnable(PathResolver pathResolver)
        {
            _okIcon = new CachedTexture
                      (
                pathResolver.ResolvePath("noun_Ok_108699-32x32.png")
                      );

            _errorIcon = new CachedTexture
                         (
                pathResolver.ResolvePath("noun_Error_2190948-32x32.png")
                         );

            _okSummaryHeaderStyle    = new StyleCache(new SummaryHeaderStyle(StyleConstants.OKColor));
            _errorSummaryHeaderStyle = new StyleCache(new SummaryHeaderStyle(StyleConstants.ErrorColor));
        }
コード例 #5
0
 public static void ClearStyleCache(this IWorkbook workbook)
 {
     StyleCache.Clear();
 }