Slider control now uses Accent Color

ComboBox enter key now uses Accent Color
Some code cleanup
Updated release notes
This commit is contained in:
BONNEVILLE Geoffroy
2018-07-24 16:26:58 +02:00
parent 7e4d6a2836
commit d6765904a1
14 changed files with 800 additions and 58 deletions
+1
View File
@@ -29,6 +29,7 @@
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants> <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@@ -3,6 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<x:Double x:Key="MenuSize">60</x:Double> <x:Double x:Key="MenuSize">60</x:Double>
<GridLength x:Key="MenuGridLength">60</GridLength> <GridLength x:Key="MenuGridLength">60</GridLength>
<SolidColorBrush x:Key="MainColor" Color="{StaticResource SystemAccentColor}" /> <SolidColorBrush x:Key="MainColor" Color="{ThemeResource SystemAccentColor}" />
<SolidColorBrush x:Key="TextColor" Color="{StaticResource SystemColorHighlightTextColor}" /> <SolidColorBrush x:Key="TextColor" Color="{ThemeResource SystemColorHighlightTextColor}" />
</ResourceDictionary> </ResourceDictionary>
@@ -191,7 +191,7 @@
To="1" /> To="1" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter"
Storyboard.TargetProperty="Foreground"> Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MainColor}" /> <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource MainColor}" />
</ObjectAnimationUsingKeyFrames> </ObjectAnimationUsingKeyFrames>
</Storyboard> </Storyboard>
</VisualState> </VisualState>
@@ -358,13 +358,13 @@
</Grid> </Grid>
</Border> </Border>
<Border x:Name="SelectedLeftIndicator" <Border x:Name="SelectedLeftIndicator"
BorderBrush="{ThemeResource MainColor}" BorderBrush="{StaticResource MainColor}"
BorderThickness="5,0,0,0" BorderThickness="5,0,0,0"
Opacity="0"/> Opacity="0"/>
<Rectangle x:Name="SelectedBorder" <Rectangle x:Name="SelectedBorder"
IsHitTestVisible="False" IsHitTestVisible="False"
Opacity="0" Opacity="0"
Stroke="{ThemeResource MainColor}" Stroke="{StaticResource MainColor}"
StrokeThickness="{ThemeResource ListViewItemSelectedBorderThemeThickness}" StrokeThickness="{ThemeResource ListViewItemSelectedBorderThemeThickness}"
Margin="0" /> Margin="0" />
<Border x:Name="SelectedCheckMarkOuter" <Border x:Name="SelectedCheckMarkOuter"
@@ -373,7 +373,7 @@
VerticalAlignment="Top" VerticalAlignment="Top"
Margin="4"> Margin="4">
<Grid x:Name="SelectedCheckMark" Opacity="0" Height="40" Width="40"> <Grid x:Name="SelectedCheckMark" Opacity="0" Height="40" Width="40">
<Path x:Name="SelectedEarmark" Data="M0,0 L40,0 L40,40 z" Fill="{ThemeResource MainColor}" Stretch="Fill"/> <Path x:Name="SelectedEarmark" Data="M0,0 L40,0 L40,40 z" Fill="{StaticResource MainColor}" Stretch="Fill"/>
<Path Data="F1 M133.1,17.9 L137.2,13.2 L144.6,19.6 L156.4,5.8 L161.2,9.9 L145.6,28.4 z" Fill="{ThemeResource ListViewItemCheckThemeBrush}" Height="13" Stretch="Fill" Width="15" HorizontalAlignment="Right" Margin="0,5.5,5.5,0" VerticalAlignment="Top" FlowDirection="LeftToRight"/> <Path Data="F1 M133.1,17.9 L137.2,13.2 L144.6,19.6 L156.4,5.8 L161.2,9.9 L145.6,28.4 z" Fill="{ThemeResource ListViewItemCheckThemeBrush}" Height="13" Stretch="Fill" Width="15" HorizontalAlignment="Right" Margin="0,5.5,5.5,0" VerticalAlignment="Top" FlowDirection="LeftToRight"/>
</Grid> </Grid>
</Border> </Border>
File diff suppressed because it is too large Load Diff
@@ -4,8 +4,6 @@ namespace ModernKeePass.Services
{ {
public abstract class SingletonServiceBase<T> where T : new() public abstract class SingletonServiceBase<T> where T : new()
{ {
protected SingletonServiceBase() { }
private static readonly Lazy<T> LazyInstance = private static readonly Lazy<T> LazyInstance =
new Lazy<T>(() => new T()); new Lazy<T>(() => new T());
@@ -16,7 +16,7 @@ namespace ModernKeePass.Views.BasePages
/// </summary> /// </summary>
public NavigationHelper NavigationHelper { get; } public NavigationHelper NavigationHelper { get; }
public virtual ListView ListView { get; set; } public ListView ListView { get; set; }
public virtual CollectionViewSource ListViewSource { get; set; } public virtual CollectionViewSource ListViewSource { get; set; }
public virtual IHasSelectableObject Model { get; set; } public virtual IHasSelectableObject Model { get; set; }
@@ -29,7 +29,7 @@ namespace ModernKeePass.Views.BasePages
// Setup the logical page navigation components that allow // Setup the logical page navigation components that allow
// the page to only show one pane at a time. // the page to only show one pane at a time.
NavigationHelper.GoBackCommand = new RelayCommand(() => GoBack(), () => CanGoBack()); NavigationHelper.GoBackCommand = new RelayCommand(GoBack, CanGoBack);
// Start listening for Window size changes // Start listening for Window size changes
// to change from showing two panes to showing a single pane // to change from showing two panes to showing a single pane
+3 -3
View File
@@ -27,7 +27,7 @@
<Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" /> <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" />
<Setter Property="Foreground" Value="{ThemeResource TextBoxForegroundThemeBrush}" /> <Setter Property="Foreground" Value="{ThemeResource TextBoxForegroundThemeBrush}" />
<Setter Property="Background" Value="{ThemeResource TextBoxBackgroundThemeBrush}" /> <Setter Property="Background" Value="{ThemeResource TextBoxBackgroundThemeBrush}" />
<Setter Property="SelectionHighlightColor" Value="{ThemeResource MainColor}" /> <Setter Property="SelectionHighlightColor" Value="{StaticResource MainColor}" />
<Setter Property="BorderBrush" Value="{ThemeResource TextBoxBorderThemeBrush}" /> <Setter Property="BorderBrush" Value="{ThemeResource TextBoxBorderThemeBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" /> <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
@@ -118,7 +118,7 @@
<Storyboard> <Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement" <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundElement"
Storyboard.TargetProperty="Background"> Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource MainColor}" /> <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource MainColor}" />
</ObjectAnimationUsingKeyFrames> </ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
Storyboard.TargetProperty="BorderBrush"> Storyboard.TargetProperty="BorderBrush">
@@ -348,7 +348,7 @@
<Run x:Uid="PasswordGeneratorLength" /> <Run x:Uid="PasswordGeneratorLength" />
<Run Text="{Binding PasswordLength}" /> <Run Text="{Binding PasswordLength}" />
</TextBlock> </TextBlock>
<Slider Value="{Binding PasswordLength, Mode=TwoWay}" Margin="0,-10,0,-20" /> <Slider Value="{Binding PasswordLength, Mode=TwoWay}" Margin="0,-10,0,-20" Style="{StaticResource MainColorSlider}"/>
<CheckBox IsChecked="{Binding UpperCasePatternSelected, Mode=TwoWay}" x:Uid="PasswordGeneratorUpper" /> <CheckBox IsChecked="{Binding UpperCasePatternSelected, Mode=TwoWay}" x:Uid="PasswordGeneratorUpper" />
<CheckBox IsChecked="{Binding LowerCasePatternSelected, Mode=TwoWay}" x:Uid="PasswordGeneratorLower" /> <CheckBox IsChecked="{Binding LowerCasePatternSelected, Mode=TwoWay}" x:Uid="PasswordGeneratorLower" />
<CheckBox IsChecked="{Binding DigitsPatternSelected, Mode=TwoWay}" x:Uid="PasswordGeneratorDigits" /> <CheckBox IsChecked="{Binding DigitsPatternSelected, Mode=TwoWay}" x:Uid="PasswordGeneratorDigits" />
@@ -27,10 +27,10 @@
<ComboBox ItemsSource="{Binding Source={StaticResource RecycleBinGroups}}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" IsEnabled="{Binding IsChecked, ElementName=RadioButton}" /> <ComboBox ItemsSource="{Binding Source={StaticResource RecycleBinGroups}}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" IsEnabled="{Binding IsChecked, ElementName=RadioButton}" />
</StackPanel> </StackPanel>
<TextBlock x:Uid="SettingsDatabaseEncryption" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,20,0,10" /> <TextBlock x:Uid="SettingsDatabaseEncryption" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,20,0,10" />
<ComboBox ItemsSource="{Binding Source={StaticResource Ciphers}}" SelectedIndex="{Binding CipherIndex, Mode=TwoWay}" ItemContainerStyle="{StaticResource MainColorComboBoxItem}" /> <ComboBox ItemsSource="{Binding Source={StaticResource Ciphers}}" SelectedIndex="{Binding CipherIndex, Mode=TwoWay}" ItemContainerStyle="{StaticResource MainColorComboBoxItem}" Style="{StaticResource MainColorComboBox}" />
<TextBlock x:Uid="SettingsDatabaseCompression" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,20,0,10" /> <TextBlock x:Uid="SettingsDatabaseCompression" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,20,0,10" />
<ComboBox ItemsSource="{Binding Source={StaticResource Compressions}}" SelectedItem="{Binding CompressionName, Mode=TwoWay}" ItemContainerStyle="{StaticResource MainColorComboBoxItem}" /> <ComboBox ItemsSource="{Binding Source={StaticResource Compressions}}" SelectedItem="{Binding CompressionName, Mode=TwoWay}" ItemContainerStyle="{StaticResource MainColorComboBoxItem}" Style="{StaticResource MainColorComboBox}" />
<TextBlock x:Uid="SettingsDatabaseKdf" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,20,0,10" /> <TextBlock x:Uid="SettingsDatabaseKdf" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,20,0,10" />
<ComboBox ItemsSource="{Binding Source={StaticResource KeyDerivations}}" SelectedItem="{Binding KeyDerivationName, Mode=TwoWay}" ItemContainerStyle="{StaticResource MainColorComboBoxItem}" /> <ComboBox ItemsSource="{Binding Source={StaticResource KeyDerivations}}" SelectedItem="{Binding KeyDerivationName, Mode=TwoWay}" ItemContainerStyle="{StaticResource MainColorComboBoxItem}" Style="{StaticResource MainColorComboBox}" />
</StackPanel> </StackPanel>
</Page> </Page>
@@ -22,7 +22,7 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<ComboBox Grid.Column="1" ItemsSource="{Binding Source={StaticResource KeyDerivations}}" SelectedItem="{Binding FileFormatVersion, Mode=TwoWay}" ItemContainerStyle="{StaticResource MainColorComboBoxItem}" /> <ComboBox Grid.Column="1" ItemsSource="{Binding Source={StaticResource KeyDerivations}}" SelectedItem="{Binding FileFormatVersion, Mode=TwoWay}" ItemContainerStyle="{StaticResource MainColorComboBoxItem}" Style="{StaticResource MainColorComboBox}" />
<Button Grid.Column="2" Style="{StaticResource TextBlockButtonStyle}"> <Button Grid.Column="2" Style="{StaticResource TextBlockButtonStyle}">
<SymbolIcon Symbol="Help" RenderTransformOrigin="0.5,0.5" > <SymbolIcon Symbol="Help" RenderTransformOrigin="0.5,0.5" >
<SymbolIcon.RenderTransform> <SymbolIcon.RenderTransform>
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"> mc:Ignorable="d">
<ComboBox x:Name="ComboBox" ItemsSource="{Binding Colors, ElementName=UserControl}" SelectionChanged="Selector_OnSelectionChanged" Loaded="ComboBox_Loaded" ItemContainerStyle="{StaticResource MainColorComboBoxItem}"> <ComboBox x:Name="ComboBox" ItemsSource="{Binding Colors, ElementName=UserControl}" SelectionChanged="Selector_OnSelectionChanged" Loaded="ComboBox_Loaded" ItemContainerStyle="{StaticResource MainColorComboBoxItem}" Style="{StaticResource MainColorComboBox}">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,0,10,0"> <StackPanel Orientation="Horizontal" Margin="0,0,10,0">
@@ -53,7 +53,7 @@
</ToolTipService.ToolTip> </ToolTipService.ToolTip>
</SymbolIcon> </SymbolIcon>
</HyperlinkButton> </HyperlinkButton>
<Button Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" Content="{Binding ButtonLabel, ElementName=UserControl}" Click="OpenButton_OnClick" Background="{ThemeResource MainColor}" Foreground="{ThemeResource TextColor}" IsEnabled="{Binding IsValid}" /> <Button Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" Content="{Binding ButtonLabel, ElementName=UserControl}" Click="OpenButton_OnClick" Style="{StaticResource MainColorButton}" IsEnabled="{Binding IsValid}" />
<TextBlock Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3" Height="Auto" FontSize="14" FontWeight="Light" Text="{Binding Status}" Foreground="{Binding StatusType, Converter={StaticResource DiscreteIntToSolidColorBrushConverter}}" Visibility="{Binding Status, Converter={StaticResource EmptyStringToVisibilityConverter}}" /> <TextBlock Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3" Height="Auto" FontSize="14" FontWeight="Light" Text="{Binding Status}" Foreground="{Binding StatusType, Converter={StaticResource DiscreteIntToSolidColorBrushConverter}}" Visibility="{Binding Status, Converter={StaticResource EmptyStringToVisibilityConverter}}" />
</Grid> </Grid>
</UserControl> </UserControl>
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"> mc:Ignorable="d">
<ComboBox x:Name="ComboBox" ItemsSource="{Binding Symbols, ElementName=UserControl}" SelectedItem="{Binding SelectedSymbol, ElementName=UserControl, Mode=TwoWay}" Loaded="ComboBox_OnLoaded" ItemContainerStyle="{StaticResource MainColorComboBoxItem}"> <ComboBox x:Name="ComboBox" ItemsSource="{Binding Symbols, ElementName=UserControl}" SelectedItem="{Binding SelectedSymbol, ElementName=UserControl, Mode=TwoWay}" Loaded="ComboBox_OnLoaded" ItemContainerStyle="{StaticResource MainColorComboBoxItem}" Style="{StaticResource MainColorComboBox}">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,0,10,0"> <StackPanel Orientation="Horizontal" Margin="0,0,10,0">
@@ -1,2 +1,3 @@
Improved search box Improved search box
Corrected startup crash Changing Windows accent color while application is still running changes main color
Corrected startup crash on some versions of Windows
@@ -1,2 +1,3 @@
Amelioration de la recherche Amelioration de la recherche
Correction de crash lors du lancement Changer la couleur de d'accentuation de Windows pendant que l'app tourne change la couleur de celle-ci
Correction de crash lors du lancement avec certaines versions de Windows