Skip to content

Commit

Permalink
Color picker now adapts to system theme, fixed settings window styles…
Browse files Browse the repository at this point in the history
… when using light theme, UI fixes
  • Loading branch information
martinchrzan committed Mar 1, 2021
1 parent ae967dc commit e3988a2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
6 changes: 6 additions & 0 deletions ColorPicker/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ColorPicker"
mc:Ignorable="d"
xmlns:ui="http://schemas.modernwpf.com/2019"
Title="Color picker settings" ResizeMode="NoResize"
Background="{DynamicResource SystemControlPageBackgroundAltHighBrush}"
Foreground="{DynamicResource SystemControlPageTextBaseHighBrush}"
ui:ThemeManager.IsThemeAware="True"
ui:TitleBar.ExtendViewIntoTitleBar="True"
ui:WindowHelper.UseModernWindowStyle="True"
ShowInTaskbar="False" WindowStartupLocation="CenterScreen" Topmost="True" WindowStyle="SingleBorderWindow" SizeToContent="WidthAndHeight">
</Window>
8 changes: 4 additions & 4 deletions ColorPicker/Views/MainView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<ColumnDefinition Width="35"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.RowSpan="2" Grid.ColumnSpan="2" Grid.Column="1" Background="#202020" BorderThickness="1" BorderBrush="Black" />

<Border Grid.RowSpan="2" Grid.ColumnSpan="2" Grid.Column="1" Background="{DynamicResource SystemControlBackgroundAltHighBrush}" BorderThickness="1" BorderBrush="#505050" />
<Border Background="{Binding DisplayedColorBrush}" BorderBrush="Black" Grid.Column="1" BorderThickness="1" Grid.RowSpan="2" x:Name="ColorBorder"/>
<TextBlock Margin="7,5,7,5" VerticalAlignment="Center" Foreground="White" Grid.Row="0" Grid.Column="2" Text="{Binding ColorString}"/>
<TextBlock Margin="7,5,7,5" VerticalAlignment="Center" Foreground="{DynamicResource SystemControlPageTextBaseHighBrush}" Grid.Row="0" Grid.Column="2" Text="{Binding ColorString}"/>

<Border BorderBrush="#505050" Grid.Column="2" Margin="0,1,1,1" Grid.RowSpan="2" BorderThickness="3,0,3,0" />
<Border BorderBrush="#505050" Grid.Column="2" Margin="0,1,1,1" Grid.RowSpan="2" BorderThickness="3,0,3,0" />
</Grid>
</Grid>
</UserControl>
11 changes: 5 additions & 6 deletions ColorPicker/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
xmlns:behaviors="clr-namespace:ColorPicker.Behaviors"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:ColorPickerSettings="clr-namespace:ColorPicker.Settings"
d:DesignHeight="450" d:DesignWidth="800" Background="#303030" Width="310">
d:DesignHeight="450" d:DesignWidth="800" Background="{DynamicResource AppBackgroundBrush}" Width="310">
<UserControl.Resources>
<Style TargetType="{x:Type TextBlock}" x:Key="NormalTextBlock">
<Style.Setters>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/>
</Style.Setters>
</Style>
Expand All @@ -35,7 +34,7 @@
<Rectangle Height="1" Fill="DarkGray" Margin="5"/>
<WrapPanel>
<TextBlock VerticalAlignment="Center" Style="{StaticResource NormalTextBlock}" FontWeight="Light" Margin="7" Text="Copied color format:"/>
<ComboBox Margin="5" Background="Black" SelectedItem="{Binding SelectedColorFormat}" ItemsSource="{Binding Source={StaticResource colorFormat}}" Width="90"/>
<ComboBox Margin="5" SelectedItem="{Binding SelectedColorFormat}" ItemsSource="{Binding Source={StaticResource colorFormat}}" Width="90"/>
</WrapPanel>

<Rectangle Height="1" Fill="DarkGray" Margin="5"/>
Expand All @@ -55,7 +54,7 @@

<Button Margin="5,-8,0,0" Grid.ColumnSpan="2" Content="Check for updates" FontWeight="Light" FontSize="13" Command="{Binding CheckForUpdatesCommand}"/>

<StackPanel Grid.Column="1" Margin="0,5,5,0">
<StackPanel Grid.Column="0" Grid.ColumnSpan="2" Margin="0,5,5,0">
<TextBlock Style="{StaticResource NormalTextBlock}" Margin="5,10,0,0" FontWeight="SemiBold" Text="{Binding ApplicationVersion, StringFormat={}Version: {0}}" HorizontalAlignment="Right"/>
<TextBlock Style="{StaticResource NormalTextBlock}" HorizontalAlignment="Right">
<Hyperlink NavigateUri="http://www.github.com/martinchrzan/ColorPicker">
Expand All @@ -71,7 +70,7 @@

</StackPanel>

<Border Background="Black" Visibility="{Binding ShowingKeyboardCaptureOverlay, Converter={StaticResource bool2VisibilityConverter}}">
<Border Background="{DynamicResource SystemControlBackgroundAltHighBrush}" Visibility="{Binding ShowingKeyboardCaptureOverlay, Converter={StaticResource bool2VisibilityConverter}}">
<StackPanel VerticalAlignment="Center">
<TextBlock Style="{StaticResource NormalTextBlock}" Text="Press keys" FontSize="15" FontWeight="Light" Margin="0,0" HorizontalAlignment="Center"/>
<TextBlock Style="{StaticResource NormalTextBlock}" Text="{Binding ShortCutPreview}" FontSize="16" FontWeight="Bold" Margin="0,15" HorizontalAlignment="Center"/>
Expand All @@ -82,7 +81,7 @@
</StackPanel>
</Border>

<Border Background="Black" Visibility="{Binding CheckingForUpdateInProgress, Converter={StaticResource bool2VisibilityConverter}}">
<Border Background="{DynamicResource SystemControlBackgroundAltHighBrush}" Visibility="{Binding CheckingForUpdateInProgress, Converter={StaticResource bool2VisibilityConverter}}">
<TextBlock Style="{StaticResource NormalTextBlock}" Text="Checking for updates" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Light"/>
</Border>

Expand Down

0 comments on commit e3988a2

Please sign in to comment.