Added possibility to change groups and entries icons

Add new entry link now hides text depending on width
TimePicker uses main color
This commit is contained in:
BONNEVILLE Geoffroy
2018-06-26 18:14:01 +02:00
parent 6f277e7b33
commit df6914d1e0
14 changed files with 327 additions and 116 deletions

View File

@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<ComboBox x:Name="ComboBox" ItemsSource="{Binding Colors, ElementName=UserControl}" SelectionChanged="Selector_OnSelectionChanged">
<ComboBox x:Name="ComboBox" ItemsSource="{Binding Colors, ElementName=UserControl}" SelectionChanged="Selector_OnSelectionChanged" Loaded="ComboBox_Loaded" ItemContainerStyle="{StaticResource MainColorComboBoxItem}">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,0,10,0">

View File

@@ -45,7 +45,6 @@ namespace ModernKeePass.Views.UserControls
ColorBrush = new SolidColorBrush((Windows.UI.Color)propertyInfo.GetValue(null, null))
});
}
ComboBox.Loaded += ComboBox_Loaded;
}
private void ComboBox_Loaded(object sender, RoutedEventArgs e)

View File

@@ -0,0 +1,17 @@
<UserControl x:Name="UserControl"
x:Class="ModernKeePass.Views.UserControls.SymbolPickerUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
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.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,0,10,0">
<SymbolIcon Symbol="{Binding}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</UserControl>

View File

@@ -0,0 +1,38 @@
using System;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
namespace ModernKeePass.Views.UserControls
{
public sealed partial class SymbolPickerUserControl
{
public Symbol[] Symbols { get; }
public Symbol SelectedSymbol
{
get { return (Symbol)GetValue(SelectedSymbolProperty); }
set { SetValue(SelectedSymbolProperty, value); }
}
public static readonly DependencyProperty SelectedSymbolProperty =
DependencyProperty.Register(
"SelectedSymbol",
typeof(Symbol),
typeof(SymbolPickerUserControl),
new PropertyMetadata(Symbol.Stop, (o, args) => { }));
public SymbolPickerUserControl()
{
InitializeComponent();
Symbols = (Symbol[])Enum.GetValues(typeof(Symbol));
}
private void ComboBox_OnLoaded(object sender, RoutedEventArgs e)
{
ComboBox.SelectedItem = Symbols.FirstOrDefault(s => s == SelectedSymbol);
}
}
}