Example #1
0
        void UpdateBackgroundBrush()
        {
            var newBackgroundBrush = GetBackgroundBrush();

            if (BrushComparer.Equals(newBackgroundBrush, backgroundBrush))
            {
                return;
            }
            backgroundBrush = newBackgroundBrush;
            if (markerElement != null)
            {
                markerElement.BackgroundBrush = backgroundBrush;
            }
        }
Example #2
0
        void UpdateBackgroundBrush()
        {
            UpdateIsInContrastModeOption();
            var newBackgroundBrush = GetBackgroundBrush();

            if (BrushComparer.Equals(newBackgroundBrush, backgroundBrush))
            {
                return;
            }
            backgroundBrush = newBackgroundBrush;
            if (markerElement != null)
            {
                markerElement.BackgroundBrush = backgroundBrush;
            }
        }
Example #3
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));
                }
            }
        }
        void UpdateLineSeparatorBrush()
        {
            if (editorFormatMap is null)
            {
                return;
            }
            var props = editorFormatMap.GetProperties(ThemeClassificationTypeNameKeys.LineSeparator);
            var brush = ResourceDictionaryUtilities.GetForegroundBrush(props);

            if (brush is null)
            {
                brush = new SolidColorBrush(Color.FromRgb(0xA5, 0xA5, 0xA5));
            }
            if (brush.CanFreeze)
            {
                brush.Freeze();
            }
            if (!BrushComparer.Equals(lineSeparatorBrush, brush))
            {
                lineSeparatorBrush = brush;
                UpdateLineSeparatorElementsForeground();
            }
        }