mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
New group text is now visible again in Group and Settings pages
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:actions="using:ModernKeePass.Actions"
|
||||
xmlns:controls="using:ModernKeePass.Controls"
|
||||
xmlns:templateSelectors="using:ModernKeePass.TemplateSelectors"
|
||||
x:Name="PageRoot"
|
||||
x:Class="ModernKeePass.Pages.GroupDetailPage"
|
||||
mc:Ignorable="d" >
|
||||
@@ -111,7 +112,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="50" x:Name="LeftListViewColumn" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListView
|
||||
@@ -126,17 +127,24 @@
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Foreground="{ThemeResource DefaultTextForegroundThemeBrush}">
|
||||
<ListView.Resources>
|
||||
<DataTemplate x:Name="Collapsed">
|
||||
<SymbolIcon Symbol="{Binding IconSymbol}" Margin="8,0,0,0">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Content="{Binding Name}" />
|
||||
</ToolTipService.ToolTip>
|
||||
</SymbolIcon>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Name="Expanded">
|
||||
<DataTemplate x:Name="GroupOtherItem">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding IconSymbol}" Margin="8,0,0,0" />
|
||||
<TextBlock Text="{Binding Name}" FontWeight="{Binding FontWeight}" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="30,0,20,0" FontStyle="{Binding IsSelected, Converter={StaticResource BooleanToFontStyleConverter}}" />
|
||||
<SymbolIcon Symbol="{Binding IconSymbol}" Margin="8,0,0,0">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Content="{Binding Name}" />
|
||||
</ToolTipService.ToolTip>
|
||||
</SymbolIcon>
|
||||
<TextBlock Text="{Binding Name}" x:Name="GroupTextBlock" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="30,0,20,0" FontStyle="{Binding IsSelected, Converter={StaticResource BooleanToFontStyleConverter}}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Name="GroupFirstItem">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding IconSymbol}" Margin="8,0,0,0">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip x:Uid="GroupNewItemTooltip" />
|
||||
</ToolTipService.ToolTip>
|
||||
</SymbolIcon>
|
||||
<TextBlock x:Name="GroupTextBlock" x:Uid="GroupNewItemTextBox" FontWeight="SemiBold" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="30,0,20,0" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.Resources>
|
||||
@@ -155,19 +163,21 @@
|
||||
<DataTemplate>
|
||||
<ToggleButton Style="{StaticResource HamburgerToggleButton}">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<core:EventTriggerBehavior EventName="Loaded">
|
||||
<core:ChangePropertyAction PropertyName="ItemTemplate" Value="{StaticResource Collapsed}" TargetObject="{Binding ElementName=LeftListView}"/>
|
||||
</core:EventTriggerBehavior>
|
||||
<core:EventTriggerBehavior EventName="Checked">
|
||||
<core:ChangePropertyAction PropertyName="ItemTemplate" Value="{StaticResource Expanded}" TargetObject="{Binding ElementName=LeftListView}"/>
|
||||
<core:ChangePropertyAction PropertyName="Width" Value="Auto" TargetObject="{Binding ElementName=LeftListViewColumn}"/>
|
||||
</core:EventTriggerBehavior>
|
||||
<core:EventTriggerBehavior EventName="Unchecked">
|
||||
<core:ChangePropertyAction PropertyName="ItemTemplate" Value="{StaticResource Collapsed}" TargetObject="{Binding ElementName=LeftListView}"/>
|
||||
<core:ChangePropertyAction PropertyName="Width" Value="50" TargetObject="{Binding ElementName=LeftListViewColumn}"/>
|
||||
</core:EventTriggerBehavior>
|
||||
</interactivity:Interaction.Behaviors>
|
||||
</ToggleButton>
|
||||
</DataTemplate>
|
||||
</ListView.HeaderTemplate>
|
||||
<ListView.ItemTemplateSelector>
|
||||
<templateSelectors:FirstItemDataTemplateSelector
|
||||
FirstItem="{StaticResource GroupFirstItem}"
|
||||
OtherItem="{StaticResource GroupOtherItem}" />
|
||||
</ListView.ItemTemplateSelector>
|
||||
</ListView>
|
||||
<!-- Horizontal scrolling grid -->
|
||||
<HyperlinkButton Grid.Column="1" VerticalAlignment="Top" Margin="40,0,0,0" Click="CreateEntry_ButtonClick" Visibility="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}" >
|
||||
|
@@ -4,7 +4,8 @@
|
||||
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"
|
||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||
xmlns:templateSelectors="using:ModernKeePass.TemplateSelectors"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<CollectionViewSource x:Name="RecycleBinGroups" Source="{Binding Groups}" />
|
||||
@@ -18,7 +19,21 @@
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<ToggleSwitch x:Uid="SettingsDatabaseRecycleBin" IsOn="{Binding HasRecycleBin, Mode=TwoWay}" />
|
||||
<ComboBox ItemsSource="{Binding Source={StaticResource RecycleBinGroups}}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" IsEnabled="{Binding HasRecycleBin}" />
|
||||
<ComboBox ItemsSource="{Binding Source={StaticResource RecycleBinGroups}}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" IsEnabled="{Binding HasRecycleBin}">
|
||||
<ComboBox.Resources>
|
||||
<DataTemplate x:Name="GroupFirstItem">
|
||||
<TextBlock x:Uid="GroupNewItemTextBox" />
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Name="GroupOtherItem">
|
||||
<TextBlock Text="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.Resources>
|
||||
<ComboBox.ItemTemplateSelector>
|
||||
<templateSelectors:FirstItemDataTemplateSelector
|
||||
FirstItem="{StaticResource GroupFirstItem}"
|
||||
OtherItem="{StaticResource GroupOtherItem}" />
|
||||
</ComboBox.ItemTemplateSelector>
|
||||
</ComboBox>
|
||||
<TextBlock x:Uid="SettingsDatabaseEncryption" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,20,0,10" />
|
||||
<ComboBox ItemsSource="{Binding Source={StaticResource Ciphers}}" SelectedIndex="{Binding CipherIndex, Mode=TwoWay}" />
|
||||
<TextBlock x:Uid="SettingsDatabaseCompression" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,20,0,10" />
|
||||
|
@@ -192,6 +192,12 @@
|
||||
<data name="GroupCreateEntry.Text" xml:space="preserve">
|
||||
<value>Create new entry</value>
|
||||
</data>
|
||||
<data name="GroupNewItemTextBox.Text" xml:space="preserve">
|
||||
<value>< New group ></value>
|
||||
</data>
|
||||
<data name="GroupNewItemTooltip.Content" xml:space="preserve">
|
||||
<value>< New group ></value>
|
||||
</data>
|
||||
<data name="GroupSearch.PlaceholderText" xml:space="preserve">
|
||||
<value>Search...</value>
|
||||
</data>
|
||||
|
@@ -192,6 +192,12 @@
|
||||
<data name="GroupCreateEntry.Text" xml:space="preserve">
|
||||
<value>Créer une nouvelle entrée</value>
|
||||
</data>
|
||||
<data name="GroupNewItemTextBox.Text" xml:space="preserve">
|
||||
<value>< Nouveau groupe ></value>
|
||||
</data>
|
||||
<data name="GroupNewItemTooltip.Content" xml:space="preserve">
|
||||
<value>< Nouveau groupe ></value>
|
||||
</data>
|
||||
<data name="GroupSearch.PlaceholderText" xml:space="preserve">
|
||||
<value>Rechercher...</value>
|
||||
</data>
|
||||
|
@@ -3,7 +3,6 @@ using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Windows.UI.Text;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using ModernKeePass.Common;
|
||||
@@ -25,15 +24,12 @@ namespace ModernKeePass.ViewModels
|
||||
}
|
||||
|
||||
public ObservableCollection<GroupVm> Groups { get; set; } = new ObservableCollection<GroupVm>();
|
||||
|
||||
public int EntryCount => Entries.Count;
|
||||
// TODO: put in a converter
|
||||
public FontWeight FontWeight => _pwGroup == null ? FontWeights.Bold : FontWeights.Normal;
|
||||
public int GroupCount => Groups.Count - 1;
|
||||
|
||||
public PwUuid IdUuid => _pwGroup?.Uuid;
|
||||
public string Id => IdUuid?.ToHexString();
|
||||
public bool IsNotRoot => ParentGroup != null;
|
||||
|
||||
|
||||
public bool ShowRestore => IsNotRoot && ParentGroup.IsSelected;
|
||||
|
||||
public bool IsRecycleOnDelete => _database.RecycleBinEnabled && !IsSelected && !ParentGroup.IsSelected;
|
||||
@@ -78,6 +74,12 @@ namespace ModernKeePass.ViewModels
|
||||
set { SetProperty(ref _isEditMode, value); }
|
||||
}
|
||||
|
||||
public bool IsMenuClosed
|
||||
{
|
||||
get { return _isMenuClosed; }
|
||||
set { SetProperty(ref _isMenuClosed, value); }
|
||||
}
|
||||
|
||||
public string Filter
|
||||
{
|
||||
get { return _filter; }
|
||||
@@ -108,6 +110,7 @@ namespace ModernKeePass.ViewModels
|
||||
private PwEntry _reorderedEntry;
|
||||
private ObservableCollection<EntryVm> _entries = new ObservableCollection<EntryVm>();
|
||||
private string _filter = string.Empty;
|
||||
private bool _isMenuClosed = true;
|
||||
|
||||
public GroupVm() {}
|
||||
|
||||
|
@@ -93,7 +93,7 @@ namespace ModernKeePass.ViewModels
|
||||
public SettingsDatabaseVm(IDatabase database)
|
||||
{
|
||||
_database = database;
|
||||
Groups = _database.RootGroup.Groups;
|
||||
Groups = _database?.RootGroup.Groups;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user