mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Root group up button disabled
Going back to home when opening a file from explorer no longer displays open file Inverted Breadcrumb order to avoid reordering items Update release notes Code cleanup
This commit is contained in:
@@ -228,13 +228,12 @@
|
|||||||
<!-- Bouton Précédent et titre de la page -->
|
<!-- Bouton Précédent et titre de la page -->
|
||||||
<Grid Grid.Row="0" Background="{ThemeResource AppBarBackgroundThemeBrush}">
|
<Grid Grid.Row="0" Background="{ThemeResource AppBarBackgroundThemeBrush}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<controls:BreadcrumbUserControl x:Name="Breadcrumb" Group="{Binding Parent}" />
|
<controls:BreadcrumbUserControl x:Name="Breadcrumb" Group="{Binding Parent}" />
|
||||||
<controls:TopMenuUserControl
|
<controls:TopMenuUserControl
|
||||||
x:Name="TopMenu" Grid.Column="2"
|
x:Name="TopMenu" Grid.Column="1"
|
||||||
MoveButtonVisibility="{Binding IsCurrentEntry, Converter={StaticResource BooleanToVisibilityConverter}}"
|
MoveButtonVisibility="{Binding IsCurrentEntry, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||||
RestoreButtonVisibility="{Binding IsCurrentEntry, Converter={StaticResource InverseBooleanToVisibilityConverter}}"
|
RestoreButtonVisibility="{Binding IsCurrentEntry, Converter={StaticResource InverseBooleanToVisibilityConverter}}"
|
||||||
SaveCommand="{Binding SaveCommand}"
|
SaveCommand="{Binding SaveCommand}"
|
||||||
|
@@ -189,12 +189,11 @@
|
|||||||
<!-- Back button and page title -->
|
<!-- Back button and page title -->
|
||||||
<Grid Grid.Row="0" Background="{ThemeResource AppBarBackgroundThemeBrush}">
|
<Grid Grid.Row="0" Background="{ThemeResource AppBarBackgroundThemeBrush}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<userControls:BreadcrumbUserControl x:Name="Breadcrumb" Group="{Binding Parent}" />
|
<userControls:BreadcrumbUserControl x:Name="Breadcrumb" Group="{Binding Parent}" />
|
||||||
<userControls:TopMenuUserControl x:Name="TopMenu" Grid.Column="2"
|
<userControls:TopMenuUserControl x:Name="TopMenu" Grid.Column="1"
|
||||||
SortButtonVisibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}"
|
SortButtonVisibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||||
EditButtonVisibility="Visible"
|
EditButtonVisibility="Visible"
|
||||||
IsEditButtonChecked="{Binding IsEditMode, Mode=TwoWay}"
|
IsEditButtonChecked="{Binding IsEditMode, Mode=TwoWay}"
|
||||||
@@ -209,7 +208,6 @@
|
|||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</userControls:TopMenuUserControl>
|
</userControls:TopMenuUserControl>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<VisualStateManager.VisualStateGroups>
|
<VisualStateManager.VisualStateGroups>
|
||||||
<VisualStateGroup x:Name="PageLayout">
|
<VisualStateGroup x:Name="PageLayout">
|
||||||
|
@@ -40,7 +40,11 @@ namespace ModernKeePass.Views
|
|||||||
protected override async void OnNavigatedTo(NavigationEventArgs e)
|
protected override async void OnNavigatedTo(NavigationEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnNavigatedTo(e);
|
base.OnNavigatedTo(e);
|
||||||
var file = e.Parameter as FileInfo;
|
FileInfo file;
|
||||||
|
if (e.NavigationMode == NavigationMode.Back)
|
||||||
|
file = null;
|
||||||
|
else
|
||||||
|
file = e.Parameter as FileInfo;
|
||||||
await Model.Initialize(Frame, MenuFrame, file);
|
await Model.Initialize(Frame, MenuFrame, file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,23 +9,29 @@
|
|||||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<StackPanel x:Name="StackPanel" Orientation="Horizontal" DataContext="{Binding Source={StaticResource Locator}, Path=Breadcrumb}">
|
<Grid x:Name="StackPanel" DataContext="{Binding Source={StaticResource Locator}, Path=Breadcrumb}">
|
||||||
<StackPanel.Resources>
|
<Grid.Resources>
|
||||||
<converters:IconToSymbolConverter x:Key="IconToSymbolConverter"/>
|
<converters:IconToSymbolConverter x:Key="IconToSymbolConverter"/>
|
||||||
<DataTemplate x:Key="FirstItemTemplate">
|
<DataTemplate x:Key="FirstItemTemplate">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=48}" Margin="0,3,0,0" />
|
|
||||||
<TextBlock Margin="10,5,10,0" Text="{Binding Name}" FontStyle="Italic" HorizontalAlignment="Center" />
|
<TextBlock Margin="10,5,10,0" Text="{Binding Name}" FontStyle="Italic" HorizontalAlignment="Center" />
|
||||||
|
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=33}" Margin="0,3,0,0" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate x:Key="OtherItemTemplate">
|
<DataTemplate x:Key="OtherItemTemplate">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Margin="10,5,10,0" Text=">" HorizontalAlignment="Center" />
|
<TextBlock Margin="10,5,10,0" Text="<" HorizontalAlignment="Center" />
|
||||||
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=48}" Margin="0,3,0,0" />
|
|
||||||
<TextBlock Margin="10,5,10,0" Text="{Binding Name}" FontStyle="Italic" HorizontalAlignment="Center" />
|
<TextBlock Margin="10,5,10,0" Text="{Binding Name}" FontStyle="Italic" HorizontalAlignment="Center" />
|
||||||
|
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=33}" Margin="0,3,0,0" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</StackPanel.Resources>
|
</Grid.Resources>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
<Button
|
<Button
|
||||||
Command="{Binding GoBackCommand}"
|
Command="{Binding GoBackCommand}"
|
||||||
Height="{StaticResource MenuHeight}"
|
Height="{StaticResource MenuHeight}"
|
||||||
@@ -37,22 +43,23 @@
|
|||||||
<SymbolIcon Symbol="Back" />
|
<SymbolIcon Symbol="Back" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
Grid.Column="1"
|
||||||
Height="{StaticResource MenuHeight}"
|
Height="{StaticResource MenuHeight}"
|
||||||
Command="{Binding GoUpCommand}"
|
Command="{Binding GoUpCommand}"
|
||||||
Style="{StaticResource NoBorderButtonStyle}">
|
Style="{StaticResource NoBorderButtonStyle}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<SymbolIcon Symbol="Up" />
|
<SymbolIcon Symbol="Up" />
|
||||||
<SymbolIcon x:Name="UpButtonIcon" Symbol="{Binding ParentGroupIcon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=48}" Margin="16,0,0,0" />
|
<SymbolIcon x:Name="UpButtonIcon" Symbol="{Binding ParentGroupIcon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=33}" Margin="16,0,0,0" />
|
||||||
<TextBlock x:Name="UpButtonText" Margin="11,2,0,0" Text="{Binding ParentGroupName}" FontStyle="Italic" FontWeight="Normal" HorizontalAlignment="Center" />
|
<TextBlock x:Name="UpButtonText" Margin="10,2,0,0" Text="{Binding ParentGroupName}" FontStyle="Italic" FontWeight="Normal" HorizontalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<ToolTipService.ToolTip>
|
<ToolTipService.ToolTip>
|
||||||
<ToolTip Content="{Binding ParentGroupName}" />
|
<ToolTip Content="{Binding ParentGroupName}" />
|
||||||
</ToolTipService.ToolTip>
|
</ToolTipService.ToolTip>
|
||||||
</Button>
|
</Button>
|
||||||
<ListView x:Name="ListView" ItemsSource="{Binding BreadcrumbItems}">
|
<ListView x:Name="ListView" Grid.Column="2" ItemsSource="{Binding BreadcrumbItems}" HorizontalAlignment="Right">
|
||||||
<ListView.ItemsPanel>
|
<ListView.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<StackPanel Orientation="Horizontal" />
|
<StackPanel FlowDirection="RightToLeft" Orientation="Horizontal" />
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ListView.ItemsPanel>
|
</ListView.ItemsPanel>
|
||||||
<ListView.ItemTemplateSelector>
|
<ListView.ItemTemplateSelector>
|
||||||
@@ -113,5 +120,5 @@
|
|||||||
</VisualState>
|
</VisualState>
|
||||||
</VisualStateGroup>
|
</VisualStateGroup>
|
||||||
</VisualStateManager.VisualStateGroups>
|
</VisualStateManager.VisualStateGroups>
|
||||||
</StackPanel>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Windows.UI.Xaml;
|
using System.Linq;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
using ModernKeePass.Application.Group.Models;
|
using ModernKeePass.Application.Group.Models;
|
||||||
using ModernKeePass.ViewModels;
|
using ModernKeePass.ViewModels;
|
||||||
|
|
||||||
@@ -22,7 +23,9 @@ namespace ModernKeePass.Views.UserControls
|
|||||||
{
|
{
|
||||||
var userControl = o as BreadcrumbUserControl;
|
var userControl = o as BreadcrumbUserControl;
|
||||||
var vm = userControl?.StackPanel.DataContext as BreadcrumbControlVm;
|
var vm = userControl?.StackPanel.DataContext as BreadcrumbControlVm;
|
||||||
if (vm != null) await vm.Initialize(args.NewValue as GroupVm).ConfigureAwait(false);
|
if (vm == null) return;
|
||||||
|
await vm.Initialize(args.NewValue as GroupVm).ConfigureAwait(false);
|
||||||
|
userControl?.ListView.ScrollIntoView(vm.BreadcrumbItems.Last());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
public BreadcrumbUserControl()
|
public BreadcrumbUserControl()
|
||||||
|
@@ -60,7 +60,7 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<ToggleButton x:Name="HamburgerButton" Style="{StaticResource HamburgerToggleButton}" IsChecked="{Binding IsOpen, ElementName=UserControl, Mode=TwoWay}" Unchecked="ToggleButton_OnUnchecked">
|
<ToggleButton Style="{StaticResource HamburgerToggleButton}" IsChecked="{Binding IsOpen, ElementName=UserControl, Mode=TwoWay}" Unchecked="ToggleButton_OnUnchecked">
|
||||||
<ToolTipService.ToolTip>
|
<ToolTipService.ToolTip>
|
||||||
<ToolTip Content="{Binding HeaderLabel, ElementName=UserControl}" />
|
<ToolTip Content="{Binding HeaderLabel, ElementName=UserControl}" />
|
||||||
</ToolTipService.ToolTip>
|
</ToolTipService.ToolTip>
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate x:Name="IsNormal">
|
<DataTemplate x:Name="IsNormal">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=48}" Margin="7,10,0,15">
|
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=33}" Margin="7,10,0,15">
|
||||||
<ToolTipService.ToolTip>
|
<ToolTipService.ToolTip>
|
||||||
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
|
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
|
||||||
</ToolTipService.ToolTip>
|
</ToolTipService.ToolTip>
|
||||||
|
@@ -1 +1,2 @@
|
|||||||
|
(Re-)Added a breadcrumb to help with navigation
|
||||||
Design improvements
|
Design improvements
|
@@ -1 +1,2 @@
|
|||||||
|
(R)Ajout du fil d'Ariane pour aider a la navigation
|
||||||
Ameliorations de design
|
Ameliorations de design
|
@@ -16,7 +16,7 @@ namespace ModernKeePass.ViewModels
|
|||||||
{
|
{
|
||||||
public ObservableCollection<BreadcrumbItem> BreadcrumbItems { get; }
|
public ObservableCollection<BreadcrumbItem> BreadcrumbItems { get; }
|
||||||
public string ParentGroupName { get; private set; }
|
public string ParentGroupName { get; private set; }
|
||||||
public Icon ParentGroupIcon { get; private set; }
|
public Icon ParentGroupIcon { get; private set; } = Icon.Folder;
|
||||||
|
|
||||||
public RelayCommand GoBackCommand { get; }
|
public RelayCommand GoBackCommand { get; }
|
||||||
public RelayCommand GoUpCommand { get; private set; }
|
public RelayCommand GoUpCommand { get; private set; }
|
||||||
@@ -33,22 +33,22 @@ namespace ModernKeePass.ViewModels
|
|||||||
BreadcrumbItems = new ObservableCollection<BreadcrumbItem>();
|
BreadcrumbItems = new ObservableCollection<BreadcrumbItem>();
|
||||||
GoBackCommand = new RelayCommand(() => _navigation.GoBack());
|
GoBackCommand = new RelayCommand(() => _navigation.GoBack());
|
||||||
GoToCommand = new RelayCommand<int>(GoTo);
|
GoToCommand = new RelayCommand<int>(GoTo);
|
||||||
|
GoUpCommand = new RelayCommand(() => GoTo(BreadcrumbItems.Count - 1), () => !string.IsNullOrEmpty(ParentGroupName));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Initialize(GroupVm group)
|
public async Task Initialize(GroupVm group)
|
||||||
{
|
{
|
||||||
GoUpCommand = new RelayCommand(() => GoTo(BreadcrumbItems.Count - 1), () => group != null);
|
|
||||||
|
|
||||||
if (group == null) return;
|
if (group == null) return;
|
||||||
|
GoBackCommand.RaiseCanExecuteChanged();
|
||||||
ParentGroupName = group.Title;
|
ParentGroupName = group.Title;
|
||||||
ParentGroupIcon = group.Icon;
|
ParentGroupIcon = group.Icon;
|
||||||
|
|
||||||
BreadcrumbItems.Insert(0, new BreadcrumbItem { Path = group.Id, Name = group.Title, Icon = group.Icon });
|
BreadcrumbItems.Add(new BreadcrumbItem { Path = group.Id, Name = group.Title, Icon = group.Icon });
|
||||||
var parentGroup = group;
|
var parentGroup = group;
|
||||||
while (!string.IsNullOrEmpty(parentGroup.ParentGroupId))
|
while (!string.IsNullOrEmpty(parentGroup.ParentGroupId))
|
||||||
{
|
{
|
||||||
parentGroup = await _mediator.Send(new GetGroupQuery {Id = parentGroup.ParentGroupId});
|
parentGroup = await _mediator.Send(new GetGroupQuery {Id = parentGroup.ParentGroupId});
|
||||||
BreadcrumbItems.Insert(0, new BreadcrumbItem {Path = parentGroup.Id, Name = parentGroup.Title, Icon = parentGroup.Icon});
|
BreadcrumbItems.Add(new BreadcrumbItem {Path = parentGroup.Id, Name = parentGroup.Title, Icon = parentGroup.Icon});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user