Skip to content

Commit

Permalink
Updated settings design
Browse files Browse the repository at this point in the history
  • Loading branch information
martinchrzan committed Dec 13, 2020
1 parent 0386ea5 commit 0d4e572
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 25 deletions.
3 changes: 3 additions & 0 deletions ColorPicker/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ColorPicker"
xmlns:ui="http://schemas.modernwpf.com/2019"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles.xaml"/>
<ResourceDictionary Source="Resources/ViewModelViewMapping.xaml"/>
<ui:ThemeResources />
<ui:XamlControlsResources />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Expand Down
3 changes: 3 additions & 0 deletions ColorPicker/ColorPicker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ModernWpfUI">
<Version>0.9.3-preview.201204.0</Version>
</PackageReference>
<PackageReference Include="NuGet.CommandLine">
<Version>5.5.1</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion ColorPicker/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
<behaviors:NotifyIconBehavior/>
<behaviors:AppearAnimationBehavior/>
</e:Interaction.Behaviors>
<ContentControl x:Name="MainView" Content="{Binding MainViewModel}"/>
<ContentControl x:Name="MainView" Content="{Binding MainViewModel}"/>
</Window>
4 changes: 2 additions & 2 deletions ColorPicker/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ColorPicker"
mc:Ignorable="d"
Title="Color picker settings" Width="300" SizeToContent="Height" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterScreen" Topmost="True" WindowStyle="SingleBorderWindow">
Title="Color picker settings" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterScreen" Topmost="True" WindowStyle="SingleBorderWindow" SizeToContent="WidthAndHeight">
</Window>
53 changes: 31 additions & 22 deletions ColorPicker/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@
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">
d:DesignHeight="450" d:DesignWidth="800" Background="#303030" 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>

<Style TargetType="{x:Type CheckBox}">
<Style.Setters>
<Setter Property="Foreground" Value="White"/>
</Style.Setters>
</Style>

<ObjectDataProvider x:Key="colorFormat" MethodName="GetValues"
ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
Expand All @@ -35,31 +29,46 @@
</e:Interaction.Behaviors>
<Grid>
<StackPanel Margin="10">
<CheckBox Margin="5" IsChecked="{Binding RunOnStartup}" Content="Run on startup"/>
<CheckBox Margin="5" IsChecked="{Binding AutomaticUpdates}" Content="Automatic updates"/>
<CheckBox Margin="5" IsChecked="{Binding ChangeCursorWhenPickingColor}" Content="Change cursor when picking color"/>
<CheckBox Margin="5,0" IsChecked="{Binding RunOnStartup}" FontWeight="Light" Content="Run on startup"/>
<CheckBox Margin="5,0" IsChecked="{Binding AutomaticUpdates}" FontWeight="Light" Content="Automatic updates"/>
<CheckBox Margin="5,0" IsChecked="{Binding ChangeCursorWhenPickingColor}" FontWeight="Light" Content="Change cursor when picking a color"/>
<Rectangle Height="1" Fill="DarkGray" Margin="5"/>
<WrapPanel>
<TextBlock VerticalAlignment="Center" Style="{StaticResource NormalTextBlock}" Margin="7" Text="Copied color format:"/>
<ComboBox Margin="5" Style="{x:Null}" Background="Black" SelectedItem="{Binding SelectedColorFormat}" ItemsSource="{Binding Source={StaticResource colorFormat}}" Width="80"/>
<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"/>
</WrapPanel>

<WrapPanel>
<TextBlock Style="{StaticResource NormalTextBlock}" Margin="7" Text="Open color picker shortcut:"/>
<TextBlock Style="{StaticResource NormalTextBlock}" Margin="5" Text="{Binding ShortCut}"/>
</WrapPanel>
<Rectangle Height="1" Fill="DarkGray" Margin="5"/>
<StackPanel>
<TextBlock Style="{StaticResource NormalTextBlock}" Margin="7" FontWeight="Light" Text="Open color picker shortcut:"/>
<TextBlock Style="{StaticResource NormalTextBlock}" Margin="7" Text="{Binding ShortCut}"/>
</StackPanel>
<Button Margin="5" Content="Change shortcut" Command="{Binding ChangeShortcutCommand}"/>

<Button Margin="5" Content="Check and install updates" Command="{Binding CheckForUpdatesCommand}"/>
<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">
<Rectangle Height="1" Fill="DarkGray" Margin="5,5,5,0"/>

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>

<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">
<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">
<e:Interaction.Behaviors>
<behaviors:HyperlinkBehavior/>
</e:Interaction.Behaviors>
Project website
</Hyperlink>
</TextBlock>
<TextBlock Style="{StaticResource NormalTextBlock}" HorizontalAlignment="Right" Text="Martin Chrzan © 2020" FontWeight="Light"/>
</TextBlock>
<TextBlock Style="{StaticResource NormalTextBlock}" HorizontalAlignment="Right" Text="Martin Chrzan © 2020" FontWeight="Light"/>
</StackPanel>
</Grid>

</StackPanel>

<Border Background="Black" Visibility="{Binding ShowingKeyboardCaptureOverlay, Converter={StaticResource bool2VisibilityConverter}}">
Expand Down

0 comments on commit 0d4e572

Please sign in to comment.