Skip to content

Commit

Permalink
Revert the StaticResource reference for SystemColors; it causes setti…
Browse files Browse the repository at this point in the history
…ngs dialog to not open consistently. Also, split all colors & brushes into its own file.
  • Loading branch information
bclothier committed Jan 18, 2020
1 parent 0996e0c commit d84a12f
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 132 deletions.
18 changes: 9 additions & 9 deletions Rubberduck.Core/UI/Controls/ToolBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{StaticResource SystemColors.MenuTextBrushKey}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="0,1,0,0"/>
<Setter Property="Padding" Value="8,3"/>
Expand Down Expand Up @@ -70,7 +70,7 @@
<Setter Property="Background" TargetName="GlyphPanel" Value="{StaticResource GlyphPanelHighlightBackgroundBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{StaticResource SystemColors.GrayTextBrushKey}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -137,7 +137,7 @@
<Setter Property="Color" TargetName="Shdw" Value="{StaticResource DropShadowColor}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{StaticResource SystemColors.GrayTextBrushKey}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<Trigger Property="CanContentScroll" SourceName="SubMenuScrollViewer" Value="False">
<Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=SubMenuScrollViewer}"/>
Expand Down Expand Up @@ -174,7 +174,7 @@
<Setter Property="Background" TargetName="Border" Value="{StaticResource HighlightBackgroundBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{StaticResource SystemColors.GrayTextBrushKey}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -245,7 +245,7 @@
<Setter Property="Color" TargetName="Shdw" Value="{StaticResource DropShadowColor}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{StaticResource SystemColors.GrayTextBrushKey}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<Trigger Property="CanContentScroll" SourceName="SubMenuScrollViewer" Value="False">
<Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=SubMenuScrollViewer}"/>
Expand Down Expand Up @@ -289,7 +289,7 @@
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
<Setter Property="Background" Value="{StaticResource SystemColors.ControlBrushKey}"/>
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down Expand Up @@ -324,7 +324,7 @@
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
<Setter Property="Background" Value="{StaticResource SystemColors.ControlBrushKey}"/>
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down Expand Up @@ -421,15 +421,15 @@
<Setter Property="Background" Value="{StaticResource ToolBarVerticalBackgroundBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{StaticResource SystemColors.GrayTextBrushKey}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
<Setter Property="Background" Value="{StaticResource SystemColors.ControlBrushKey}"/>
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down
130 changes: 7 additions & 123 deletions Rubberduck.Core/UI/Styles/DefaultStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,126 +3,10 @@
xmlns:converters="clr-namespace:Rubberduck.UI.Converters;assembly="
xmlns:settings="clr-namespace:Rubberduck.UI.Settings"
xmlns:settingsConverters="clr-namespace:Rubberduck.UI.Settings.Converters">

<Color x:Key="HighlightGradientStartColor">#FFD9F4FF</Color>
<Color x:Key="HighlightGradientEndColor">#FF9BDDFB</Color>
<Color x:Key="ControlGradientStartColor">#FFEEEDED</Color>
<Color x:Key="ControlGradientEndColor">#FFDDDDDD</Color>
<Color x:Key="ButtonFaceColor">#FFD3D3D3</Color>
<Color x:Key="BorderWireColor">#FF696969</Color>
<Color x:Key="GlyphPanelColor">#FFF8F8FF</Color>
<Color x:Key="GlyphPanelTemplateColor">#FF212121</Color>
<Color x:Key="GlyphPanelBorderColor">#80DADADA</Color>
<Color x:Key="DropShadowColor">#71000000</Color>
<Color x:Key="GreenButtonColor">#FF40C954</Color>
<Color x:Key="GreenButtonBorderColor">#FF008000</Color>
<Color x:Key="GreenButtonMouseOverColor">#FF61D156</Color>
<Color x:Key="HighlightBorderColor">#80DADADA</Color>
<Color x:Key="HighlightBorderActiveColor">#FFADC6E5</Color>
<Color x:Key="HighlightBackgroundColor">#210080FF</Color>
<Color x:Key="HighlightInactiveBorderColor">#FFD3D3D3</Color>
<Color x:Key="GlyphPanelHighlightBorderColor">#90006CD9</Color>
<Color x:Key="GlyphPanelHighlightBackgroundColor">#90006CD9</Color>
<Color x:Key="MouseOverBackgroundColor">#1F26A0DA</Color>
<Color x:Key="MouseOverBorderColor">#A826A0DA</Color>
<Color x:Key="ExpanderBorderColor">#FFA9A9A9</Color>
<Color x:Key="ExpanderBackgroundColor">#FFFFFFFF</Color>
<Color x:Key="CaptionLightColor">#FFFFFFFF</Color>
<Color x:Key="CaptionDarkColor">#FF000000</Color>
<Color x:Key="CaptionErrorColor">#FFFF0000</Color>
<Color x:Key="CaptionDisabledColor">#FF808080</Color>
<Color x:Key="CaptionHyperlinkColor">#FF0000FF</Color>
<Color x:Key="CaptionHyperlinkVisitedColor">#FFFF0000</Color>
<Color x:Key="BackgroundDarkColor">#FFA9A9A9</Color>
<Color x:Key="BackgroundLightColor">#FFF5F5F5</Color>
<Color x:Key="BackgroundSoftColor">#FFF8F8FF</Color>
<Color x:Key="HeaderBackgroundDarkColor">#FFA9A9A9</Color>
<Color x:Key="TabSelectionUnderlineColor">#FF0000FF</Color>
<Color x:Key="GrayColor">#FF696969</Color>
<Color x:Key="BlackColor">#FFFFFFFF</Color>
<Color x:Key="WhiteColor">#FF000000</Color>
<Color x:Key="BusyIndicatorFillColor">#FF00569A</Color>

<Color x:Key="ToolBarButtonHoverColor">#210080FF</Color>
<Color x:Key="ToolBarGripperColor">#FF6D6D6D</Color>
<Color x:Key="ToolBarBackgroundColor">#FFEEF5FD</Color>
<Color x:Key="ToolBarVerticalBackgroundColor">#FFEEF5FD</Color>
<Color x:Key="ToolBarHorizontalBackgroundColor">#FFEEF5FD</Color>
<Color x:Key="ToolBarToggleButtonVerticalBackgroundColor">#FFEEF5FD</Color>
<Color x:Key="ToolBarToggleButtonHorizontalBackgroundColor">#FFEEF5FD</Color>
<Color x:Key="ToolBarMenuBorderColor">#FFB6BDC5</Color>
<Color x:Key="ToolBarSubMenuBackgroundColor">#FFEEF5FD</Color>

<SolidColorBrush x:Key="HighlightGradientStartBrush" Color="{StaticResource HighlightGradientStartColor}"/>
<SolidColorBrush x:Key="HighlightGradientEndBrush" Color="{StaticResource HighlightGradientEndColor}"/>
<SolidColorBrush x:Key="ControlGradientStartBrush" Color="{StaticResource ControlGradientStartColor}"/>
<SolidColorBrush x:Key="ControlGradientEndBrush" Color="{StaticResource ControlGradientEndColor}"/>
<SolidColorBrush x:Key="ButtonFaceBrush" Color="{StaticResource ButtonFaceColor}"/>
<SolidColorBrush x:Key="BorderWireBrush" Color="{StaticResource BorderWireColor}"/>
<SolidColorBrush x:Key="GlyphPanelBrush" Color="{StaticResource GlyphPanelColor}"/>
<SolidColorBrush x:Key="GlyphPanelTemplateBrush" Color="{StaticResource GlyphPanelTemplateColor}"/>
<SolidColorBrush x:Key="GlyphPanelBorderBrush" Color="{StaticResource GlyphPanelBorderColor}"/>
<SolidColorBrush x:Key="GreenButtonBrush" Color="{StaticResource GreenButtonColor}"/>
<SolidColorBrush x:Key="GreenButtonBorderBrush" Color="{StaticResource GreenButtonBorderColor}"/>
<SolidColorBrush x:Key="GreenButtonMouseOverBrush" Color="{StaticResource GreenButtonMouseOverColor}"/>
<SolidColorBrush x:Key="HighlightBorderBrush" Color="{StaticResource HighlightBorderColor}"/>
<SolidColorBrush x:Key="HighlightBorderActiveBrush" Color="{StaticResource HighlightBorderActiveColor}"/>
<SolidColorBrush x:Key="HighlightBackgroundBrush" Color="{StaticResource HighlightBackgroundColor}"/>
<SolidColorBrush x:Key="HighlightInactiveBorderBrush" Color="{StaticResource HighlightInactiveBorderColor}"/>
<SolidColorBrush x:Key="GlyphPanelHighlightBorderBrush" Color="{StaticResource HighlightBorderColor}"/>
<SolidColorBrush x:Key="GlyphPanelHighlightBackgroundBrush" Color="{StaticResource HighlightBackgroundColor}"/>
<SolidColorBrush x:Key="MouseOverBackgroundBrush" Color="{StaticResource MouseOverBackgroundColor}"/>
<SolidColorBrush x:Key="MouseOverBorderBrush" Color="{StaticResource MouseOverBorderColor}"/>
<SolidColorBrush x:Key="ExpanderBackgroundBrush" Color="{StaticResource ExpanderBackgroundColor}"/>
<SolidColorBrush x:Key="ExpanderBorderBrush" Color="{StaticResource ExpanderBorderColor}"/>
<SolidColorBrush x:Key="CaptionLightBrush" Color="{StaticResource CaptionLightColor}"/>
<SolidColorBrush x:Key="CaptionDarkBrush" Color="{StaticResource CaptionDarkColor}"/>
<SolidColorBrush x:Key="CaptionErrorBrush" Color="{StaticResource CaptionErrorColor}"/>
<SolidColorBrush x:Key="CaptionDisabledBrush" Color="{StaticResource CaptionDisabledColor}"/>
<SolidColorBrush x:Key="CaptionHyperlinkBrush" Color="{StaticResource CaptionHyperlinkColor}"/>
<SolidColorBrush x:Key="CaptionHyperlinkVisitedBrush" Color="{StaticResource CaptionHyperlinkVisitedColor}"/>
<SolidColorBrush x:Key="BackgroundDarkBrush" Color="{StaticResource BackgroundDarkColor}"/>
<SolidColorBrush x:Key="BackgroundLightBrush" Color="{StaticResource BackgroundLightColor}"/>
<SolidColorBrush x:Key="BackgroundWhiteBrush" Color="{StaticResource BackgroundWhiteColor}"/>
<SolidColorBrush x:Key="BackgroundSoftBrush" Color="{StaticResource BackgroundSoftColor}"/>
<SolidColorBrush x:Key="HeaderBackgroundDarkBrush" Color="{StaticResource HeaderBackgroundDarkColor}"/>
<SolidColorBrush x:Key="TabSelectionUnderlineBrush" Color="{StaticResource TabSelectionUnderlineColor}"/>
<SolidColorBrush x:Key="GrayBrush" Color="{StaticResource GrayColor}"/>
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource BlackColor}"/>
<SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource WhiteColor}"/>
<SolidColorBrush x:Key="BusyIndicatorFillBrush" Color="{StaticResource BusyIndicatorFillColor}"/>

<SolidColorBrush x:Key="ToolBarButtonHoverBrush" Color="{StaticResource ToolBarButtonHoverColor}"/>
<SolidColorBrush x:Key="ToolBarGripperBrush" Color="{StaticResource ToolBarGripperColor}"/>
<SolidColorBrush x:Key="ToolBarBackgroundBrush" Color="{StaticResource ToolBarBackgroundColor}"/>
<SolidColorBrush x:Key="ToolBarVerticalBackgroundBrush" Color="{StaticResource ToolBarVerticalBackgroundColor}"/>
<SolidColorBrush x:Key="ToolBarHorizontalBackgroundBrush" Color="{StaticResource ToolBarHorizontalBackgroundColor}"/>
<SolidColorBrush x:Key="ToolBarToggleButtonVerticalBackgroundBrush" Color="{StaticResource ToolBarToggleButtonVerticalBackgroundColor}"/>
<SolidColorBrush x:Key="ToolBarToggleButtonHorizontalBackgroundBrush" Color="{StaticResource ToolBarToggleButtonHorizontalBackgroundColor}"/>
<SolidColorBrush x:Key="ToolBarMenuBorderBrush" Color="{StaticResource ToolBarMenuBorderColor}"/>
<SolidColorBrush x:Key="ToolBarSubMenuBackgroundBrush" Color="{StaticResource ToolBarSubMenuBackgroundColor}"/>

<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="{StaticResource WhiteColor}" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{StaticResource WhiteColor}" />

<LinearGradientBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="{StaticResource HighlightGradientStartColor}" Offset="0"/>
<GradientStop Color="{StaticResource HighlightGradientEndColor}" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="{x:Static SystemColors.ControlBrushKey}" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="{StaticResource ControlGradientStartColor}" Offset="0"/>
<GradientStop Color="{StaticResource ControlGradientEndColor}" Offset="1"/>
</LinearGradientBrush>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="LightBlueTheme.xaml"/>
</ResourceDictionary.MergedDictionaries>

<LinearGradientBrush x:Key="Item.SelectedActive.Background" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="{StaticResource HighlightGradientStartColor}" Offset="0"/>
<GradientStop Color="{StaticResource HighlightGradientEndColor}" Offset="1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="Item.SelectedInactive.Background" EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="{StaticResource ControlGradientStartColor}" Offset="0"/>
<GradientStop Color="{StaticResource ControlGradientEndColor}" Offset="1"/>
</LinearGradientBrush>

<Style x:Key="ToolbarIconStyle" TargetType="Image">
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
Expand Down Expand Up @@ -150,15 +34,15 @@
<Condition Property="Selector.IsSelectionActive" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{StaticResource HighlightBorderActiveBrush}"/>
<Setter Property="Background" Value="{StaticResource SystemColors.HighlightBrushKey}" />
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True" />
<Condition Property="Selector.IsSelectionActive" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{StaticResource HighlightInactiveBorderBrush}"/>
<Setter Property="Background" Value="{StaticResource SystemColors.InactiveSelectionHighlightBrushKey}" />
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
</MultiTrigger>
</Style.Triggers>
</Style>
Expand All @@ -167,7 +51,7 @@
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{StaticResource SystemColors.ControlTextBrushKey}" StrokeThickness="1" StrokeDashArray="1 2"/>
<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down Expand Up @@ -221,7 +105,7 @@
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource HighlightBorderActiveBrush}"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="TextElement.Foreground" TargetName="Bd" Value="{StaticResource SystemColors.GrayTextBrushKey}"/>
<Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down
Loading

0 comments on commit d84a12f

Please sign in to comment.