mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Semantic Zoom now has grouped zoomed out view
New button to open browser to Entry Url Entries are now sorted alphabetically
This commit is contained in:

committed by
BONNEVILLE Geoffroy

parent
3d033417ad
commit
dfb5ec9683
@@ -38,13 +38,18 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</StackPanel.Resources>
|
</StackPanel.Resources>
|
||||||
<TextBlock x:Name="userTextBlock" TextWrapping="Wrap" Text="User name or login" FontSize="18"/>
|
<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" />
|
<TextBox x:Name="userTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding UserName, Mode=TwoWay}" Width="350" Height="32" />
|
||||||
<TextBlock x:Name="passwordTextBlock" TextWrapping="Wrap" Text="Password" FontSize="18"/>
|
<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" Visibility="{Binding IsRevealPassword, Converter={StaticResource InverseBooleanToVisibilityConverter}}" />
|
<PasswordBox x:Name="passwordBox" HorizontalAlignment="Left" Password="{Binding Password, Mode=TwoWay}" Width="350" Height="32" IsPasswordRevealButtonEnabled="True" Visibility="{Binding IsRevealPassword, Converter={StaticResource InverseBooleanToVisibilityConverter}}" />
|
||||||
<TextBox x:Name="passwordTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Password, Mode=TwoWay}" Width="350" Visibility="{Binding IsRevealPassword, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
<TextBox x:Name="passwordTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Password, Mode=TwoWay}" Width="350" Height="32" Visibility="{Binding IsRevealPassword, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
||||||
<CheckBox x:Name="checkBox" HorizontalAlignment="Left" Margin="-3,0,0,0" Content="Show password" IsChecked="{Binding IsRevealPassword, Mode=TwoWay}"/>
|
<CheckBox x:Name="checkBox" HorizontalAlignment="Left" Margin="-3,0,0,0" Content="Show password" IsChecked="{Binding IsRevealPassword, Mode=TwoWay}"/>
|
||||||
<TextBlock x:Name="urlTextBlock" TextWrapping="Wrap" Text="URL" FontSize="18"/>
|
<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" />
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="350" >
|
||||||
|
<TextBox x:Name="urlTextBox" TextWrapping="Wrap" Text="{Binding Url, Mode=TwoWay}" Height="32" Width="300" MaxLength="256" />
|
||||||
|
<Button Click="UrlButton_Click" Height="32" BorderThickness="0" Background="Transparent" Margin="0">
|
||||||
|
<SymbolIcon Symbol="Forward" VerticalAlignment="Center" />
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
<TextBlock x:Name="notesTextBlock" TextWrapping="Wrap" Text="Notes" FontSize="18"/>
|
<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" />
|
<TextBox x:Name="notesTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Notes, Mode=TwoWay}" Width="350" Height="200" AcceptsReturn="True" IsSpellCheckEnabled="True" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
@@ -76,5 +76,18 @@ namespace ModernKeePass.Pages
|
|||||||
entry?.RemoveEntry();
|
entry?.RemoveEntry();
|
||||||
if (Frame.CanGoBack) Frame.GoBack();
|
if (Frame.CanGoBack) Frame.GoBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void UrlButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var uri = new Uri(urlTextBox.Text);
|
||||||
|
await Windows.System.Launcher.LaunchUriAsync(uri);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// TODO: Show some error
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,10 @@
|
|||||||
Source="{Binding Groups}"/>
|
Source="{Binding Groups}"/>
|
||||||
<CollectionViewSource
|
<CollectionViewSource
|
||||||
x:Name="EntriesViewSource"
|
x:Name="EntriesViewSource"
|
||||||
Source="{Binding Entries}"/>
|
Source="{Binding Entries}" />
|
||||||
|
<CollectionViewSource
|
||||||
|
x:Name="EntriesZoomedOutViewSource"
|
||||||
|
Source="{Binding EntriesZoomedOut}" IsSourceGrouped="True"/>
|
||||||
</Grid.Resources>
|
</Grid.Resources>
|
||||||
<Grid.ChildrenTransitions>
|
<Grid.ChildrenTransitions>
|
||||||
<TransitionCollection>
|
<TransitionCollection>
|
||||||
@@ -170,15 +173,33 @@
|
|||||||
<SemanticZoom.ZoomedOutView>
|
<SemanticZoom.ZoomedOutView>
|
||||||
<ListView
|
<ListView
|
||||||
x:Name="SemanticListView"
|
x:Name="SemanticListView"
|
||||||
ItemsSource="{Binding Source={StaticResource EntriesViewSource}}"
|
ItemsSource="{Binding Source={StaticResource EntriesZoomedOutViewSource}}"
|
||||||
IsSwipeEnabled="false"
|
IsSwipeEnabled="false"
|
||||||
SelectionChanged="groups_SelectionChanged"
|
SelectionChanged="groups_SelectionChanged"
|
||||||
IsSynchronizedWithCurrentItem="False" >
|
IsSynchronizedWithCurrentItem="False">
|
||||||
|
<ListView.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListView.ItemsPanel>
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
|
<StackPanel Orientation="Vertical">
|
||||||
<TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap"/>
|
<TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap"/>
|
||||||
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListView.ItemTemplate>
|
</ListView.ItemTemplate>
|
||||||
|
<ListView.GroupStyle>
|
||||||
|
<GroupStyle HidesIfEmpty="True">
|
||||||
|
<GroupStyle.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid Background="LightGray" Margin="0">
|
||||||
|
<TextBlock Text="{Binding Key}" Foreground="Black" Margin="30" Style="{StaticResource HeaderTextBlockStyle}"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</GroupStyle.HeaderTemplate>
|
||||||
|
</GroupStyle>
|
||||||
|
</ListView.GroupStyle>
|
||||||
</ListView>
|
</ListView>
|
||||||
</SemanticZoom.ZoomedOutView>
|
</SemanticZoom.ZoomedOutView>
|
||||||
</SemanticZoom>
|
</SemanticZoom>
|
||||||
|
@@ -43,6 +43,7 @@ namespace ModernKeePass.Pages
|
|||||||
var mru = StorageApplicationPermissions.MostRecentlyUsedList;
|
var mru = StorageApplicationPermissions.MostRecentlyUsedList;
|
||||||
var file = await mru.GetFileAsync(recentVm.SelectedItem.Token);
|
var file = await mru.GetFileAsync(recentVm.SelectedItem.Token);
|
||||||
|
|
||||||
|
// TODO: this closes the current opened database
|
||||||
var app = (App)Application.Current;
|
var app = (App)Application.Current;
|
||||||
app.Database = new DatabaseHelper(file);
|
app.Database = new DatabaseHelper(file);
|
||||||
}
|
}
|
||||||
|
@@ -12,18 +12,32 @@ namespace ModernKeePass.ViewModels
|
|||||||
{
|
{
|
||||||
public GroupVm ParentGroup { get; }
|
public GroupVm ParentGroup { get; }
|
||||||
public ObservableCollection<EntryVm> Entries { get; set; } = new ObservableCollection<EntryVm>();
|
public ObservableCollection<EntryVm> Entries { get; set; } = new ObservableCollection<EntryVm>();
|
||||||
|
|
||||||
public ObservableCollection<GroupVm> Groups { get; set; } = new ObservableCollection<GroupVm>();
|
public ObservableCollection<GroupVm> Groups { get; set; } = new ObservableCollection<GroupVm>();
|
||||||
|
|
||||||
public int EntryCount => Entries.Count - 1;
|
public int EntryCount => Entries.Count() - 1;
|
||||||
public int GroupCount => Groups.Count - 1;
|
public int GroupCount => Groups.Count - 1;
|
||||||
public bool IsNotRoot => ParentGroup != null;
|
public bool IsNotRoot => ParentGroup != null;
|
||||||
public FontWeight FontWeight => _pwGroup == null ? FontWeights.Bold : FontWeights.Normal;
|
public FontWeight FontWeight => _pwGroup == null ? FontWeights.Bold : FontWeights.Normal;
|
||||||
|
|
||||||
|
public IOrderedEnumerable<IGrouping<char, EntryVm>> EntriesZoomedOut
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return from e in Entries
|
||||||
|
where e.Entry != null
|
||||||
|
group e by e.Title.FirstOrDefault() into grp
|
||||||
|
orderby grp.Key
|
||||||
|
select grp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return _pwGroup == null ? "New group" : _pwGroup.Name; }
|
get { return _pwGroup == null ? "New group" : _pwGroup.Name; }
|
||||||
set { _pwGroup.Name = value; }
|
set { _pwGroup.Name = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Symbol IconSymbol
|
public Symbol IconSymbol
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -56,11 +70,9 @@ namespace ModernKeePass.ViewModels
|
|||||||
{
|
{
|
||||||
_pwGroup = pwGroup;
|
_pwGroup = pwGroup;
|
||||||
ParentGroup = parent;
|
ParentGroup = parent;
|
||||||
Entries = new ObservableCollection<EntryVm>(pwGroup.Entries.Select(e => new EntryVm(e, this)));
|
Entries = new ObservableCollection<EntryVm>(pwGroup.Entries.Select(e => new EntryVm(e, this)).OrderBy(e => e.Title));
|
||||||
Entries.Insert(0, new EntryVm ());
|
Entries.Insert(0, new EntryVm ());
|
||||||
//Entries.Add(new EntryVm { Title = " New entry" });
|
Groups = new ObservableCollection<GroupVm>(pwGroup.Groups.Select(g => new GroupVm(g, this)).OrderBy(g => g.Name));
|
||||||
Groups = new ObservableCollection<GroupVm>(pwGroup.Groups.Select(g => new GroupVm(g, this)));
|
|
||||||
//Groups.Insert(0, new GroupVm { Name = " + New group" });
|
|
||||||
Groups.Insert(0, new GroupVm ());
|
Groups.Insert(0, new GroupVm ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user