예제 #1
0
        void UpdateLineElementBrushes()
        {
            var props = editorFormatMap.GetProperties(isActive ? ThemeClassificationTypeNameKeys.CurrentLine : ThemeClassificationTypeNameKeys.CurrentLineNoFocus);

            currentLineHighlighterElement.ForegroundBrush = ResourceDictionaryUtilities.GetForegroundBrush(props);
            currentLineHighlighterElement.BackgroundBrush = ResourceDictionaryUtilities.GetBackgroundBrush(props);
        }
예제 #2
0
        void UpdateBackground()
        {
            if (editorFormatMap == null)
            {
                return;
            }
            var props         = editorFormatMap.GetProperties(ThemeClassificationTypeNameKeys.GlyphMargin);
            var newBackground = ResourceDictionaryUtilities.GetBackgroundBrush(props, Brushes.Transparent);

            if (!BrushComparer.Equals(Background, newBackground))
            {
                Background = newBackground;
                // The images could depend on the background color, so recreate every icon
                if (childCanvases.Any(a => a.Children.Count > 0))
                {
                    Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(RefreshEverything));
                }
            }
        }
예제 #3
0
        void UpdateLineSeparatorBrush()
        {
            if (editorFormatMap == null)
            {
                return;
            }
            var props = editorFormatMap.GetProperties(ThemeClassificationTypeNameKeys.LineSeparator);
            var brush = ResourceDictionaryUtilities.GetForegroundBrush(props);

            if (brush == null)
            {
                brush = new SolidColorBrush(Color.FromRgb(0xA5, 0xA5, 0xA5));
            }
            if (brush.CanFreeze)
            {
                brush.Freeze();
            }
            if (!BrushComparer.Equals(lineSeparatorBrush, brush))
            {
                lineSeparatorBrush = brush;
                UpdateLineSeparatorElementsForeground();
            }
        }
예제 #4
0
        void UpdateBackground()
        {
            var bgProps = editorFormatMap.GetProperties(EditorFormatMapConstants.TextViewBackgroundId);

            Background = ResourceDictionaryUtilities.GetBackgroundBrush(bgProps, SystemColors.WindowBrush);
        }
예제 #5
0
        Brush GetBackgroundBrush()
        {
            var props = editorFormatMap.GetProperties(IsActive ? ThemeClassificationTypeNameKeys.SelectedText : ThemeClassificationTypeNameKeys.InactiveSelectedText);

            return(ResourceDictionaryUtilities.GetBackgroundBrush(props, IsActive ? SystemColors.HighlightBrush : SystemColors.GrayTextBrush));
        }