Skip to content

Commit

Permalink
style: Options ureadable in VS 2022 Preview 4, dark theme. #122
Browse files Browse the repository at this point in the history
  • Loading branch information
Samir L. Boulema committed Sep 21, 2021
1 parent 5b269c3 commit 5b86102
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 9 deletions.
19 changes: 18 additions & 1 deletion CodeNav.Shared/Windows/FilterWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,24 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<DataGrid ItemsSource="{Binding FilterRules}" />
<DataGrid ItemsSource="{Binding FilterRules}" Background="Transparent">
<DataGrid.Resources>
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTextBrushKey}}"/>
</Style>
<Style TargetType="{x:Type DataGridColumnHeader}" >
<Setter Property="Background" Value="{DynamicResource {x:Static platform:EnvironmentColors.PageSideBarExpanderHeaderBrushKey}}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTextBrushKey}}" />
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1 1 1 1"/>
<Setter Property="Margin" Value="-1,-1,0,0" />
<Setter Property="Padding" Value="5" />
<Setter Property="Width" Value="auto"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
</DataGrid.Resources>
</DataGrid>

<Grid Grid.Row="1" Margin="0,5,0,0">
<Grid>
Expand Down
68 changes: 60 additions & 8 deletions CodeNav.Shared/Windows/OptionsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,55 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<TabControl>
<TabControl Background="Transparent">
<TabControl.Resources>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Border>
<Grid>
<Border x:Name="border"
Background="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTabMouseOverBorderBrushKey}}">
<ContentPresenter x:Name="cp" ContentSource="Header"
Margin="12,2,12,2"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border"
Property="Background"
Value="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTabMouseOverBorderBrushKey}}" />
<Setter TargetName="cp"
Property="TextElement.Foreground"
Value="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTabMouseOverTextBrushKey}}" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="border"
Property="Background"
Value="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTabBorderBrushKey}}" />
<Setter TargetName="cp"
Property="TextElement.Foreground"
Value="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTabSelectedTextBrushKey}}" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="border"
Property="Background"
Value="{DynamicResource {x:Static platform:EnvironmentColors.FileTabBorderBrushKey}}" />
<Setter TargetName="cp"
Property="TextElement.Foreground"
Value="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTabTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</TabControl.Resources>

<TabItem Header="General">
<Grid Margin="5">
<Grid.RowDefinitions>
Expand All @@ -42,8 +90,10 @@

<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="0,0,5,0" VerticalAlignment="Center">
Show CodeNav on this side of the code editor:
<TextBlock Margin="0,0,5,0"
VerticalAlignment="Center"
Foreground="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTextBrushKey}}">
Show CodeNav on this side of the code editor:
</TextBlock>
<ComboBox ItemsSource="{Binding Source={StaticResource marginSidesFromEnum}}" SelectedItem="{Binding MarginSide, Mode=TwoWay}" />
</StackPanel>
Expand All @@ -65,8 +115,10 @@
</CheckBox>

<StackPanel Orientation="Horizontal" Margin="0,5">
<TextBlock Margin="0,0,5,0" VerticalAlignment="Center">
Do not auto load CodeNav for files with more than X lines:
<TextBlock Margin="0,0,5,0"
VerticalAlignment="Center"
Foreground="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTextBrushKey}}">
Do not auto load CodeNav for files with more than X lines:
</TextBlock>
<TextBox Text="{Binding AutoLoadLineThreshold, Mode=TwoWay}"></TextBox>
</StackPanel>
Expand All @@ -76,7 +128,7 @@
<TabItem Header="Fonts &amp; Colors">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Margin="0,0,5,0">
<TextBlock Margin="0,0,5,0" Foreground="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTextBrushKey}}">
Font:
</TextBlock>
<Button Click="ShowFontDialog">
Expand All @@ -85,7 +137,7 @@
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Margin="0,0,5,0">
<TextBlock Margin="0,0,5,0" Foreground="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTextBrushKey}}">
Highlight background:
</TextBlock>
<Button Click="ShowHighlightColorDialog" Background="{Binding HighlightBrush}">
Expand All @@ -94,7 +146,7 @@
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Margin="0,0,5,0">
<TextBlock Margin="0,0,5,0" Foreground="{DynamicResource {x:Static platform:EnvironmentColors.ToolWindowTextBrushKey}}">
Window background:
</TextBlock>
<Button Click="ShowBackgroundColorDialog" Background="{Binding BackgroundBrush}">
Expand Down

0 comments on commit 5b86102

Please sign in to comment.