mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Added icons to main menu
Added icons to entries and groups with a mapping Created a Converter to handle pluralization Several UI enhancements
This commit is contained in:
@@ -25,29 +25,23 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="1" x:Name="contentRegion">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock x:Name="userTextBlock" Grid.Row="0" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="User name or login" VerticalAlignment="Top" FontSize="18"/>
|
||||
<TextBox x:Name="userTextBox" Grid.Row="1" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="{Binding UserName, Mode=TwoWay}" VerticalAlignment="Top" Width="250" AllowDrop="True"/>
|
||||
<TextBlock x:Name="passwordTextBlock" Grid.Row="2" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Password" VerticalAlignment="Top" FontSize="18"/>
|
||||
<PasswordBox x:Name="passwordBox" Grid.Row="3" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Password="{Binding Password, Mode=TwoWay}" IsPasswordRevealButtonEnabled="True" Width="250" AllowDrop="True"/>
|
||||
<TextBox x:Name="passwordTextBox" Grid.Row="3" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="{Binding Password, Mode=TwoWay}" VerticalAlignment="Top" Width="250" FontSize="14,667" MaxLength="256" AllowDrop="True" Visibility="Collapsed"/>
|
||||
<CheckBox x:Name="checkBox" Grid.Row="4" Content="Show password" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Checked="checkBox_Checked" Unchecked="checkBox_Unchecked"/>
|
||||
<TextBlock x:Name="urlTextBlock" Grid.Row="5" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="URL" VerticalAlignment="Top" FontSize="18"/>
|
||||
<TextBox x:Name="urlTextBox" Grid.Row="6" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="{Binding Url, Mode=TwoWay}" VerticalAlignment="Top" Width="250" FontSize="14,667" MaxLength="256" AllowDrop="True"/>
|
||||
<TextBlock x:Name="notesTextBlock" Grid.Row="7" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Notes" VerticalAlignment="Top" FontSize="18"/>
|
||||
<TextBox x:Name="notesTextBox" Grid.Row="8" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="{Binding Notes, Mode=TwoWay}" VerticalAlignment="Top" Width="250" Height="32" IsSpellCheckEnabled="True" AllowDrop="True"/>
|
||||
</Grid>
|
||||
<StackPanel Grid.Row="1" Margin="20,0,0,0" >
|
||||
<StackPanel.Resources>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Margin" Value="0,20,0,0"/>
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<TextBlock x:Name="userTextBlock" TextWrapping="Wrap" Text="User name or login" FontSize="18"/>
|
||||
<TextBox x:Name="userTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding UserName, Mode=TwoWay}" Width="350" />
|
||||
<TextBlock x:Name="passwordTextBlock" TextWrapping="Wrap" Text="Password" FontSize="18"/>
|
||||
<PasswordBox x:Name="passwordBox" HorizontalAlignment="Left" Password="{Binding Password, Mode=TwoWay}" Width="350" IsPasswordRevealButtonEnabled="True" />
|
||||
<TextBox x:Name="passwordTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Password, Mode=TwoWay}" Width="350" Visibility="Collapsed"/>
|
||||
<CheckBox x:Name="checkBox" HorizontalAlignment="Left" Margin="-3,0,0,0" Content="Show password" Checked="checkBox_Checked" Unchecked="checkBox_Unchecked" />
|
||||
<TextBlock x:Name="urlTextBlock" TextWrapping="Wrap" Text="URL" FontSize="18"/>
|
||||
<TextBox x:Name="urlTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Url, Mode=TwoWay}" Width="350" MaxLength="256" />
|
||||
<TextBlock x:Name="notesTextBlock" TextWrapping="Wrap" Text="Notes" FontSize="18"/>
|
||||
<TextBox x:Name="notesTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Notes, Mode=TwoWay}" Width="350" Height="200" AcceptsReturn="True" IsSpellCheckEnabled="True" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Bouton Précédent et titre de la page -->
|
||||
<Grid>
|
||||
|
@@ -6,14 +6,27 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ViewModels="using:ModernKeePass.ViewModels"
|
||||
xmlns:Converters="using:ModernKeePass.Converters"
|
||||
x:Name="pageRoot"
|
||||
x:Class="ModernKeePass.Pages.GroupDetailPage"
|
||||
mc:Ignorable="d" >
|
||||
<Page.Resources>
|
||||
<Converters:PluralizationConverter x:Key="PluralizationConverter"/>
|
||||
</Page.Resources>
|
||||
<Page.DataContext>
|
||||
<ViewModels:GroupVm />
|
||||
</Page.DataContext>
|
||||
|
||||
|
||||
<Grid>
|
||||
|
||||
<Grid.Resources>
|
||||
<CollectionViewSource
|
||||
x:Name="groupsViewSource"
|
||||
Source="{Binding Groups}"/>
|
||||
<CollectionViewSource
|
||||
x:Name="entriesViewSource"
|
||||
Source="{Binding Entries}"/>
|
||||
</Grid.Resources>
|
||||
<Grid.ChildrenTransitions>
|
||||
<TransitionCollection>
|
||||
<EntranceThemeTransition/>
|
||||
@@ -24,14 +37,6 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.Resources>
|
||||
<CollectionViewSource
|
||||
x:Name="groupsViewSource"
|
||||
Source="{Binding Groups}"/>
|
||||
<CollectionViewSource
|
||||
x:Name="entriesViewSource"
|
||||
Source="{Binding Entries}"/>
|
||||
</Grid.Resources>
|
||||
<!-- Horizontal scrolling grid -->
|
||||
<GridView
|
||||
x:Name="groupsGridView"
|
||||
@@ -44,41 +49,49 @@
|
||||
ItemsSource="{Binding Source={StaticResource groupsViewSource}}"
|
||||
IsSwipeEnabled="false"
|
||||
SelectionChanged="groupsGridView_SelectionChanged"
|
||||
SelectedIndex="-1" >
|
||||
IsSynchronizedWithCurrentItem="False" >
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Height="110" Width="480" Margin="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Background="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="110" Height="110">
|
||||
<Image Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
|
||||
</Border>
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0">
|
||||
<TextBlock Text="{Binding Name}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap"/>
|
||||
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="NoWrap"/>
|
||||
<TextBlock Text="{Binding EntryCount}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60"/>
|
||||
<TextBlock Text="{Binding GroupCount}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Border BorderThickness="2" BorderBrush="DimGray" Background="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="0,10,0,0" >
|
||||
<Grid Height="110" Width="480" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<SymbolIcon Grid.Column="0" Symbol="{Binding IconSymbol}" Width="100" Height="100" />
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0">
|
||||
<TextBlock Text="{Binding Name}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap"/>
|
||||
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="NoWrap"/>
|
||||
<TextBlock Text="{Binding EntryCount, ConverterParameter=entry\,entries, Converter={StaticResource PluralizationConverter}}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60"/>
|
||||
<TextBlock Text="{Binding GroupCount, ConverterParameter=group\,groups, Converter={StaticResource PluralizationConverter}}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
<GridView.Header>
|
||||
<StackPanel Width="480" Margin="0,4,14,0">
|
||||
<ListView x:Name="entriesListView" Height="auto" ItemsSource="{Binding Source={StaticResource entriesViewSource}}" Margin="10,0,0,0" SelectionChanged="entriesListView_SelectionChanged">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</StackPanel>
|
||||
<ListView
|
||||
x:Name="entriesListView"
|
||||
Height="auto"
|
||||
Width="480"
|
||||
ItemsSource="{Binding Source={StaticResource entriesViewSource}}"
|
||||
Margin="10,0,0,0"
|
||||
SelectionChanged="entriesListView_SelectionChanged"
|
||||
IsSynchronizedWithCurrentItem="False" >
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding IconSymbol}" Margin="0,5,0,0"/>
|
||||
<TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
<ListView.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="Entries" FontSize="20" Margin="0,20,0,20" />
|
||||
</DataTemplate>
|
||||
</ListView.HeaderTemplate>
|
||||
</ListView>
|
||||
</GridView.Header>
|
||||
<GridView.ItemContainerStyle>
|
||||
<Style TargetType="FrameworkElement">
|
||||
@@ -99,7 +112,7 @@
|
||||
AutomationProperties.Name="Back"
|
||||
AutomationProperties.AutomationId="BackButton"
|
||||
AutomationProperties.ItemType="Navigation Button"/>
|
||||
<TextBlock x:Name="pageTitle" Text="{Binding Path=Name}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1"
|
||||
<TextBlock x:Name="pageTitle" Text="{Binding Name}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1"
|
||||
IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
@@ -62,8 +62,6 @@ namespace ModernKeePass.Pages
|
||||
|
||||
if (!(e.Parameter is GroupVm)) return;
|
||||
DataContext = (GroupVm) e.Parameter;
|
||||
groupsGridView.SelectedIndex = -1;
|
||||
entriesListView.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
|
@@ -32,7 +32,7 @@
|
||||
<HyperlinkButton Grid.Row="1" Grid.ColumnSpan="2" Content="From Url..." IsEnabled="False" />
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Visibility="{Binding SelectedVisibility}" TextWrapping="Wrap" Text="{Binding Name}" VerticalAlignment="Center" Height="auto" Width="auto" FontSize="16" Margin="10,7,0,6" />
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left" Visibility="{Binding SelectedVisibility}" TextWrapping="Wrap" Text="Password" VerticalAlignment="Center" Height="auto" Width="auto" FontSize="16" Margin="10,7,0,6" />
|
||||
<PasswordBox Grid.Row="3" Grid.Column="1" x:Name="PasswordBox" Visibility="{Binding SelectedVisibility}" Width="500" IsPasswordRevealButtonEnabled="True" Margin="0,0,10,0"/>
|
||||
<PasswordBox Grid.Row="3" Grid.Column="1" x:Name="PasswordBox" Visibility="{Binding SelectedVisibility}" Width="500" IsPasswordRevealButtonEnabled="True" Margin="0,0,10,0" KeyDown="PasswordBox_KeyDown"/>
|
||||
<TextBlock Grid.Row="4" Grid.Column="1" x:Name="StatusTextBlock" Visibility="{Binding SelectedVisibility}" Height="auto" Width="auto" Foreground="#FF9E1B1B" FontSize="16" />
|
||||
<Button Grid.Row="5" Grid.Column="1" Content="OK" Visibility="{Binding SelectedVisibility}" HorizontalAlignment="Right" VerticalAlignment="Top" Click="OpenButton_OnClick" Margin="0,0,7,0" Width="auto"/>
|
||||
</Grid>
|
||||
|
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using Windows.Storage.Pickers;
|
||||
using Windows.System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using ModernKeePass.Common;
|
||||
using ModernKeePass.ViewModels;
|
||||
@@ -49,6 +51,7 @@ namespace ModernKeePass.Pages
|
||||
databaseVm.Name = file.Name;
|
||||
databaseVm.NotifyPropertyChanged("SelectedVisibility");
|
||||
databaseVm.NotifyPropertyChanged("Name");
|
||||
PasswordBox.Focus(FocusState.Programmatic);
|
||||
}
|
||||
|
||||
private void OpenButton_OnClick(object sender, RoutedEventArgs e)
|
||||
@@ -57,5 +60,10 @@ namespace ModernKeePass.Pages
|
||||
StatusTextBlock.Text = app.Database.Open(PasswordBox.Password);
|
||||
if (string.IsNullOrEmpty(StatusTextBlock.Text)) _mainFrame.Navigate(typeof(GroupDetailPage), app.Database.RootGroup);
|
||||
}
|
||||
|
||||
private void PasswordBox_KeyDown(object sender, KeyRoutedEventArgs e)
|
||||
{
|
||||
if (e.Key == VirtualKey.Enter) OpenButton_OnClick(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,6 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<HyperlinkButton Grid.Row="0" x:Name="SaveButton" Content="Save and close" Click="SaveButton_OnClick" VerticalAlignment="Top" IsEnabled="{Binding IsOpen}" />
|
||||
<HyperlinkButton Grid.Row="1" x:Name="SaveAsButton" Content="Save as..." VerticalAlignment="Top" IsEnabled="{Binding IsOpen}" />
|
||||
|
||||
<HyperlinkButton Grid.Row="1" x:Name="SaveAsButton" Content="Save as..." VerticalAlignment="Top" IsEnabled="False" />
|
||||
</Grid>
|
||||
</Page>
|
||||
|
Reference in New Issue
Block a user