feat(app): complete the Library: timeline, saved views, quick and mass actions, remote cards
The Library gets a third layout (year bands of photos per month over the card grid; a month narrows to its year and scrolls to it), saved views stored as app-scope settings rows, hover quick actions on cards and rows (open, analyse, render the sequence's preset, sync), the full mass actions bar (analyse, proxies, verify, tags, rating, move, upload, download, delete into the trash, CSV) with each button's reason when it cannot run, and, while signed in, the server's sequences without a local copy as remote cards filterable by origin. Delete shows the engine's dry run behind a typed confirmation and offers Undo; the Archive manager gets Delete… and a Trash dialog that restores sequences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
27 files changed
+2582
-422
No files matched your search
@@ -7,156 +7,34 @@
|
||||
xmlns:ar="clr-namespace:Titano.App.Archiving"
|
||||
xmlns:shell="clr-namespace:Titano.App.Shell">
|
||||
<UserControl.Resources>
|
||||
<Style x:Key="Text.PanelHeading" TargetType="TextBlock" BasedOn="{StaticResource Text.Section}">
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style x:Key="Button.Bar" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="Margin" Value="0,0,8,0" />
|
||||
</Style>
|
||||
<Style x:Key="Button.Tool" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Margin" Value="0,0,8,8" />
|
||||
</Style>
|
||||
<!-- Rows that only show text: focusable, so the arrow keys move through a long list. -->
|
||||
<Style x:Key="ListBoxItem.Preview" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Row}">
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding To}" />
|
||||
</Style>
|
||||
<!-- Report rows with their own buttons: Tab reaches every button. -->
|
||||
<Style x:Key="ListBoxItem.Duplicate" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.PlainRow}">
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding Row.Title}" />
|
||||
</Style>
|
||||
<!-- A filter menu: its values, each checked while chosen. -->
|
||||
<Style x:Key="MenuItem.Choice" TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
|
||||
<Setter Property="Header" Value="{Binding Label}" />
|
||||
<Setter Property="IsChecked" Value="{Binding IsChecked, Mode=OneWay}" />
|
||||
<Setter Property="Command" Value="{Binding Command}" />
|
||||
<Setter Property="ToolTip" Value="{l:Loc Tooltips.Archive.FilterChoice}" />
|
||||
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
|
||||
</Style>
|
||||
|
||||
<!-- Dialog card (DESIGN §4: Surface, Stroke, radius 12, 24 px shadow, two buttons). -->
|
||||
<Style x:Key="Border.Dialog" TargetType="Border">
|
||||
<Setter Property="Background" Value="{DynamicResource Brush.Surface}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Stroke}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="CornerRadius" Value="{StaticResource Radius.Dialog}" />
|
||||
<Setter Property="Padding" Value="24,18,24,20" />
|
||||
<Setter Property="Effect" Value="{StaticResource Shadow.Popup}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<DataTemplate DataType="{x:Type ar:RebuildDialogViewModel}">
|
||||
<Border Style="{StaticResource Border.Dialog}" Width="520">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{l:Loc Archive.Rebuild.Heading}" Style="{StaticResource Text.Title}" />
|
||||
<ItemsControl ItemsSource="{Binding FactRows}" Focusable="False" Margin="0,14,0,0">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type ar:DialogFact}">
|
||||
<Grid Margin="0,0,0,8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Label}" Style="{StaticResource Text.Label}" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding Value}" TextTrimming="CharacterEllipsis" ToolTip="{Binding Value}" Typography.NumeralAlignment="Tabular" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" Visibility="{Binding BusyText, Converter={x:Static ui:NullToCollapsedConverter.Instance}}" />
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,18,0,0">
|
||||
<Button Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsDefault="True" IsCancel="True"
|
||||
MinWidth="96" />
|
||||
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Archive.Rebuild.Start}" Command="{Binding RebuildCommand}" ToolTip="{Binding RebuildToolTip}"
|
||||
MinWidth="96" Margin="8,0,0,0" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type ar:RenameDialogViewModel}">
|
||||
<Border Style="{StaticResource Border.Dialog}" Width="720" MaxHeight="560">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" />
|
||||
<Grid Grid.Row="1" Margin="0,14,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{l:Loc Archive.Rename.Template}" Style="{StaticResource Text.Label}" />
|
||||
<TextBox Grid.Column="1" Style="{StaticResource TextBox.Mono}" Text="{Binding Template.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
|
||||
shell:EditBehavior.Field="{Binding Template}" ToolTip="{Binding Template.ToolTip}" AutomationProperties.Name="{l:Loc Archive.Rename.Template}" />
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="2" Text="{Binding SummaryText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,12,0,6" Typography.NumeralAlignment="Tabular" />
|
||||
<ListBox Grid.Row="3" ItemsSource="{Binding Rows}" ItemContainerStyle="{StaticResource ListBoxItem.Preview}" MinHeight="120"
|
||||
AutomationProperties.Name="{l:Loc Archive.Rename.Preview}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type ar:RenameRow}">
|
||||
<Grid Height="30" TextElement.FontSize="12">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MinWidth="120" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" MinWidth="120" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Style="{StaticResource Text.Cell}" Text="{Binding From}" Foreground="{DynamicResource Brush.TextMuted}" ToolTip="{Binding From}" />
|
||||
<ui:Icon Grid.Column="1" Glyph="{StaticResource Icon.Forward}" Margin="10,0" Foreground="{DynamicResource Brush.TextFaint}" />
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource Text.Cell}" Text="{Binding To}" ToolTip="{Binding To}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<DockPanel Grid.Row="4" Margin="0,16,0,0">
|
||||
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Primary}" Content="{l:Loc Archive.Rename.Apply}" Command="{Binding ApplyCommand}"
|
||||
ToolTip="{Binding ApplyToolTip}" MinWidth="96" Margin="8,0,0,0" />
|
||||
<Button DockPanel.Dock="Right" Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsCancel="True"
|
||||
MinWidth="96" />
|
||||
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type ar:RetagDialogViewModel}">
|
||||
<Border Style="{StaticResource Border.Dialog}" Width="520">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" />
|
||||
<Grid Margin="0,14,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{l:Loc Archive.Retag.Add}" Style="{StaticResource Text.Label}" />
|
||||
<TextBox Grid.Column="1" Text="{Binding Add.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}" shell:EditBehavior.Field="{Binding Add}"
|
||||
ToolTip="{Binding Add.ToolTip}" AutomationProperties.Name="{l:Loc Archive.Retag.Add}" />
|
||||
<TextBlock Grid.Row="1" Text="{l:Loc Archive.Retag.Remove}" Style="{StaticResource Text.Label}" Margin="0,10,14,0" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Margin="0,10,0,0" Text="{Binding Remove.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
|
||||
shell:EditBehavior.Field="{Binding Remove}" ToolTip="{Binding Remove.ToolTip}" AutomationProperties.Name="{l:Loc Archive.Retag.Remove}" />
|
||||
</Grid>
|
||||
<TextBlock Text="{Binding SummaryText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,12,0,0" Typography.NumeralAlignment="Tabular" />
|
||||
<DockPanel Margin="0,18,0,0">
|
||||
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Primary}" Content="{l:Loc Archive.Retag.Apply}" Command="{Binding ApplyCommand}"
|
||||
ToolTip="{Binding ApplyToolTip}" MinWidth="96" Margin="8,0,0,0" />
|
||||
<Button DockPanel.Dock="Right" Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsCancel="True"
|
||||
MinWidth="96" />
|
||||
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Titano;component/Archive/ArchiveDialogs.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<Style x:Key="Text.PanelHeading" TargetType="TextBlock" BasedOn="{StaticResource Text.Section}">
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style x:Key="Button.Bar" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="Margin" Value="0,0,8,0" />
|
||||
</Style>
|
||||
<Style x:Key="Button.Tool" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Margin" Value="0,0,8,8" />
|
||||
</Style>
|
||||
<!-- Report rows with their own buttons: Tab reaches every button. -->
|
||||
<Style x:Key="ListBoxItem.Duplicate" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.PlainRow}">
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding Row.Title}" />
|
||||
</Style>
|
||||
<!-- A filter menu: its values, each checked while chosen. -->
|
||||
<Style x:Key="MenuItem.Choice" TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
|
||||
<Setter Property="Header" Value="{Binding Label}" />
|
||||
<Setter Property="IsChecked" Value="{Binding IsChecked, Mode=OneWay}" />
|
||||
<Setter Property="Command" Value="{Binding Command}" />
|
||||
<Setter Property="ToolTip" Value="{l:Loc Tooltips.Archive.FilterChoice}" />
|
||||
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
@@ -203,6 +81,7 @@
|
||||
<MenuItem Header="{l:Loc Archive.Maintenance.DryRun}" Command="{Binding MaintenanceDryRunCommand}" ToolTip="{l:Loc Tooltips.Archive.MaintenanceDryRun}" ToolTipService.ShowOnDisabled="True" />
|
||||
<MenuItem Header="{l:Loc Archive.Maintenance.Proxies}" Command="{Binding RebuildProxiesCommand}" ToolTip="{Binding RebuildProxiesToolTip}" ToolTipService.ShowOnDisabled="True" />
|
||||
<MenuItem Header="{l:Loc Archive.Maintenance.Backup}" Command="{Binding BackupCommand}" ToolTip="{l:Loc Tooltips.Archive.Backup}" ToolTipService.ShowOnDisabled="True" />
|
||||
<MenuItem Header="{l:Loc Archive.Maintenance.Trash}" Command="{Binding TrashCommand}" ToolTip="{l:Loc Tooltips.Archive.Trash}" ToolTipService.ShowOnDisabled="True" />
|
||||
<Separator />
|
||||
<MenuItem Header="{l:Loc Archive.Maintenance.Relink}" Command="{Binding RelinkCommand}" ToolTip="{l:Loc Tooltips.Archive.Relink}" ToolTipService.ShowOnDisabled="True" />
|
||||
</ContextMenu>
|
||||
@@ -513,6 +392,8 @@
|
||||
<Button Style="{StaticResource Button.Bar}" Margin="0,0,8,8" Content="{l:Loc Archive.Set.Move}" Command="{Binding MoveSetCommand}" ToolTip="{Binding MoveSetToolTip}" />
|
||||
<Button Style="{StaticResource Button.Bar}" Margin="0,0,8,8" Content="{l:Loc Archive.Set.Retag}" Command="{Binding RetagSetCommand}" ToolTip="{Binding RetagSetToolTip}" />
|
||||
<Button Style="{StaticResource Button.Bar}" Margin="0,0,8,8" Content="{l:Loc Archive.Set.Export}" Command="{Binding ExportSetCommand}" ToolTip="{Binding ExportSetToolTip}" />
|
||||
<Button Style="{StaticResource Button.Destructive}" Height="30" Margin="0,0,8,8" Content="{l:Loc Archive.Set.Delete}" Command="{Binding DeleteSetCommand}"
|
||||
ToolTip="{Binding DeleteSetToolTip}" />
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
|
||||
@@ -521,7 +402,7 @@
|
||||
</ui:EmptyState>
|
||||
</Grid>
|
||||
|
||||
<!-- In-window dialogs (rebuild, rename, retag) over a scrim; the keyboard stays inside the dialog. -->
|
||||
<!-- In-window dialogs (rebuild, rename, retag, trash) over a scrim; the keyboard stays inside the dialog. -->
|
||||
<Grid Visibility="{Binding IsDialogOpen, Converter={StaticResource BoolToVisibility}}" KeyboardNavigation.TabNavigation="Cycle"
|
||||
KeyboardNavigation.ControlTabNavigation="Cycle" KeyboardNavigation.DirectionalNavigation="Contained">
|
||||
<Border Background="{DynamicResource Brush.Scrim}" />
|
||||
|
||||
@@ -25,8 +25,9 @@ namespace Titano.App.Sections;
|
||||
/// <summary>
|
||||
/// Archive manager (BRIEF §12.5, Archive.html): the archive's tree (years, sequences) with its availability, its
|
||||
/// figures and charts, mass operations on the selected and filtered set (analyse, proxies, thumbnails, verify, rename,
|
||||
/// move, retag, CSV), and the operations on the whole archive as jobs (scan, rebuild with its dialog, verify,
|
||||
/// maintenance), plus the maintenance view: index health, duplicates and orphans with safe fixes, recent runs. The
|
||||
/// move, retag, CSV, delete into the trash), and the operations on the whole archive as jobs (scan, rebuild with its
|
||||
/// dialog, verify, maintenance), the trash, plus the maintenance view: index health, duplicates and orphans with safe
|
||||
/// fixes, recent runs. The
|
||||
/// tree selection is only ever changed by the user: reloads and expanding keep it.
|
||||
/// </summary>
|
||||
public sealed class ArchiveViewModel : SectionViewModel
|
||||
@@ -96,6 +97,8 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
MoveSetCommand = new AsyncRelayCommand(() => OpenRenameDialogAsync(RenameMode.Folders), () => HasSet() && IsOnline());
|
||||
RetagSetCommand = new RelayCommand(OpenRetag, () => HasSet() && IsOnline());
|
||||
ExportSetCommand = new AsyncRelayCommand(ExportAsync, HasSet);
|
||||
DeleteSetCommand = new AsyncRelayCommand(() => SequenceDeletion.RunAsync(Shell, [.. Set().Select(s => s.Id)]), () => HasSet() && IsOnline());
|
||||
TrashCommand = new AsyncRelayCommand(OpenTrashAsync, () => _archive is not null);
|
||||
|
||||
FindDuplicatesCommand = new AsyncRelayCommand(FindDuplicatesAsync, () => _archive is not null && _search is null);
|
||||
FindOrphansCommand = new AsyncRelayCommand(FindOrphansAsync, () => IsOnline() && _search is null);
|
||||
@@ -161,6 +164,7 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
public string RenameSetToolTip => WhenSet("Tooltips.Archive.SetRename", needsOnline: true);
|
||||
public string MoveSetToolTip => WhenSet("Tooltips.Archive.SetMove", needsOnline: true);
|
||||
public string RetagSetToolTip => WhenSet("Tooltips.Archive.SetRetag", needsOnline: true);
|
||||
public string DeleteSetToolTip => WhenSet("Tooltips.Archive.SetDelete", needsOnline: true);
|
||||
|
||||
public ICommand ScanCommand { get; }
|
||||
public ICommand RebuildCommand { get; }
|
||||
@@ -177,6 +181,9 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
public ICommand RelinkCommand { get; }
|
||||
public ICommand HistoryCommand { get; }
|
||||
|
||||
/// <summary>"Maintenance ▾ › Trash…": the sequences deleted from this archive, each restorable.</summary>
|
||||
public ICommand TrashCommand { get; }
|
||||
|
||||
// ---------------- Overview ----------------
|
||||
|
||||
public ObservableCollection<ArchiveTreeRowViewModel> TreeRows { get; } = [];
|
||||
@@ -239,6 +246,9 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
public ICommand RetagSetCommand { get; }
|
||||
public ICommand ExportSetCommand { get; }
|
||||
|
||||
/// <summary>Moves the set to the archive's trash after its dry run and a typed confirmation.</summary>
|
||||
public ICommand DeleteSetCommand { get; }
|
||||
|
||||
/// <summary>The view reports the rows the user selected; the list's own clearing while rows are rebuilt is not a choice.</summary>
|
||||
public void SetSelection(IEnumerable<ArchiveTreeRowViewModel> rows)
|
||||
{
|
||||
@@ -310,7 +320,7 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
|
||||
// ---------------- Dialogs ----------------
|
||||
|
||||
/// <summary>The open in-window dialog (rebuild, rename, retag); null when none.</summary>
|
||||
/// <summary>The open in-window dialog (rebuild, rename, retag, trash); null when none.</summary>
|
||||
public ArchiveDialogViewModel? Dialog
|
||||
{
|
||||
get => _dialog;
|
||||
@@ -499,6 +509,7 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
OnPropertyChanged(nameof(RenameSetToolTip));
|
||||
OnPropertyChanged(nameof(MoveSetToolTip));
|
||||
OnPropertyChanged(nameof(RetagSetToolTip));
|
||||
OnPropertyChanged(nameof(DeleteSetToolTip));
|
||||
CommandManager.InvalidateRequerySuggested();
|
||||
}
|
||||
|
||||
@@ -625,6 +636,19 @@ public sealed class ArchiveViewModel : SectionViewModel
|
||||
await dialog.PlanAsync();
|
||||
}
|
||||
|
||||
/// <summary>Opens the trash of the archive and reads it.</summary>
|
||||
public async Task OpenTrashAsync()
|
||||
{
|
||||
if (Services.Archives is not { } archives || _archive is not { } archive) return;
|
||||
var dialog = new TrashDialogViewModel(archives, archive, async () =>
|
||||
{
|
||||
await LoadAsync();
|
||||
await Shell.Library.RefreshAsync();
|
||||
}, CloseDialog);
|
||||
OpenDialog(dialog);
|
||||
await dialog.LoadAsync();
|
||||
}
|
||||
|
||||
private void OpenRetag()
|
||||
{
|
||||
if (Services.Archives is not { } archives) return;
|
||||
|
||||
@@ -4,180 +4,310 @@
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:v="clr-namespace:Titano.Ui.Visuals;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
|
||||
xmlns:lib="clr-namespace:Titano.App.Library">
|
||||
xmlns:lib="clr-namespace:Titano.App.Library"
|
||||
xmlns:shell="clr-namespace:Titano.App.Shell">
|
||||
<UserControl.Resources>
|
||||
<Style x:Key="ListBoxItem.LibraryCard" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Card}">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
|
||||
</Style>
|
||||
<Style x:Key="ListBoxItem.LibraryRow" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Row}">
|
||||
<Setter Property="Height" Value="38" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
|
||||
</Style>
|
||||
<Style x:Key="Button.Header" TargetType="Button" BasedOn="{StaticResource Button.Subtle}">
|
||||
<Setter Property="Height" Value="28" />
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="FontSize" Value="11" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource Brush.TextFaint}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="ui:ControlState.HoverBackground" Value="Transparent" />
|
||||
</Style>
|
||||
<DataTemplate x:Key="Template.Status" DataType="{x:Type v:CardStatus}">
|
||||
<ui:StatusGlyph Kind="{Binding Kind}" Text="{Binding Text}" ToolTip="{Binding ToolTip}" Margin="0,0,8,0" />
|
||||
</DataTemplate>
|
||||
<ItemsPanelTemplate x:Key="Panel.Row">
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Titano;component/Archive/ArchiveDialogs.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<Style x:Key="ListBoxItem.LibraryCard" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Card}">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
|
||||
</Style>
|
||||
<Style x:Key="ListBoxItem.LibraryRow" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Row}">
|
||||
<Setter Property="Height" Value="38" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
|
||||
</Style>
|
||||
<Style x:Key="Button.Header" TargetType="Button" BasedOn="{StaticResource Button.Subtle}">
|
||||
<Setter Property="Height" Value="28" />
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="FontSize" Value="11" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource Brush.TextFaint}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="ui:ControlState.HoverBackground" Value="Transparent" />
|
||||
</Style>
|
||||
<Style x:Key="Button.Bar" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="Margin" Value="0,0,8,8" />
|
||||
</Style>
|
||||
<!-- Quick actions revealed on a card (28 px) or a row (26 px, DESIGN §4). -->
|
||||
<Style x:Key="Button.Quick" TargetType="Button" BasedOn="{StaticResource Button.Icon}">
|
||||
<Setter Property="Width" Value="28" />
|
||||
<Setter Property="Height" Value="28" />
|
||||
<Setter Property="MinWidth" Value="28" />
|
||||
<Setter Property="Margin" Value="6,0,0,0" />
|
||||
</Style>
|
||||
<Style x:Key="Button.RowQuick" TargetType="Button" BasedOn="{StaticResource Button.Quick}">
|
||||
<Setter Property="Width" Value="26" />
|
||||
<Setter Property="Height" Value="26" />
|
||||
<Setter Property="MinWidth" Value="26" />
|
||||
</Style>
|
||||
<!-- A menu of choices (saved views, ratings): each checked while it is the one in force. -->
|
||||
<Style x:Key="MenuItem.View" TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
|
||||
<Setter Property="Header" Value="{Binding Label}" />
|
||||
<Setter Property="IsChecked" Value="{Binding IsChecked, Mode=OneWay}" />
|
||||
<Setter Property="Command" Value="{Binding Command}" />
|
||||
<Setter Property="ToolTip" Value="{l:Loc Tooltips.Library.ViewChoice}" />
|
||||
</Style>
|
||||
<Style x:Key="MenuItem.Rating" TargetType="MenuItem" BasedOn="{StaticResource MenuItem.View}">
|
||||
<Setter Property="ToolTip" Value="{l:Loc Tooltips.Library.RateChoice}" />
|
||||
</Style>
|
||||
<DataTemplate x:Key="Template.Status" DataType="{x:Type v:CardStatus}">
|
||||
<ui:StatusGlyph Kind="{Binding Kind}" Text="{Binding Text}" ToolTip="{Binding ToolTip}" Margin="0,0,8,0" />
|
||||
</DataTemplate>
|
||||
<ItemsPanelTemplate x:Key="Panel.Row">
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<!-- Save view / Rename view: one name field. -->
|
||||
<DataTemplate DataType="{x:Type lib:ViewNameDialogViewModel}">
|
||||
<Border Style="{StaticResource Border.Dialog}" Width="460">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" />
|
||||
<Grid Margin="0,14,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{l:Loc Library.Views.Name}" Style="{StaticResource Text.Label}" />
|
||||
<TextBox Grid.Column="1" Text="{Binding Name.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}" shell:EditBehavior.Field="{Binding Name}"
|
||||
ToolTip="{Binding Name.ToolTip}" AutomationProperties.Name="{l:Loc Library.Views.Name}" />
|
||||
</Grid>
|
||||
<DockPanel Margin="0,18,0,0">
|
||||
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Primary}" Content="{l:Loc Library.Views.Save}" Command="{Binding SaveCommand}"
|
||||
ToolTip="{Binding SaveToolTip}" IsDefault="True" MinWidth="96" Margin="8,0,0,0" />
|
||||
<Button DockPanel.Dock="Right" Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsCancel="True"
|
||||
MinWidth="96" />
|
||||
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="56" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid IsEnabled="{Binding IsContentEnabled}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="56" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Toolbar (Main.html): search, filters, sort · view switch, rescan. -->
|
||||
<DockPanel Grid.ColumnSpan="2" Margin="20,0" LastChildFill="False">
|
||||
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Icon}" ui:ButtonIcon.Glyph="{StaticResource Icon.Refresh}" Command="{Binding RescanCommand}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Rescan}" AutomationProperties.Name="{l:Loc Library.Rescan}" Margin="10,0,0,0" />
|
||||
<v:SegmentedControl DockPanel.Dock="Right" SelectedIndex="{Binding LayoutIndex, Mode=TwoWay}" AutomationProperties.Name="{l:Loc Library.View}">
|
||||
<v:SegmentedItem Glyph="{StaticResource Icon.ViewGrid}" ToolTip="{l:Loc Tooltips.Library.Grid}" AutomationProperties.Name="{l:Loc Library.View.Grid}" />
|
||||
<v:SegmentedItem Glyph="{StaticResource Icon.ViewList}" ToolTip="{l:Loc Tooltips.Library.List}" AutomationProperties.Name="{l:Loc Library.View.List}" />
|
||||
</v:SegmentedControl>
|
||||
<TextBox Width="260" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" ui:Field.Glyph="{StaticResource Icon.Search}"
|
||||
ui:Field.Placeholder="{l:Loc Library.Search}" ToolTip="{l:Loc Tooltips.Library.Search}" AutomationProperties.Name="{l:Loc Library.Search}" />
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Years}" SelectedItem="{Binding SelectedYear}" Tag="{Binding IsYearFiltered}"
|
||||
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Year}" AutomationProperties.Name="{l:Loc Library.Filter.Year}" />
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Cameras}" SelectedItem="{Binding SelectedCamera}" Tag="{Binding IsCameraFiltered}"
|
||||
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Camera}" AutomationProperties.Name="{l:Loc Library.Filter.Camera}" />
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Statuses}" SelectedItem="{Binding SelectedStatus}" Tag="{Binding IsStatusFiltered}"
|
||||
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Status}" AutomationProperties.Name="{l:Loc Library.Filter.Status}" />
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Tags}" SelectedItem="{Binding SelectedTag}" Tag="{Binding IsTagFiltered}"
|
||||
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Tags}" AutomationProperties.Name="{l:Loc Library.Filter.Tags}" />
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Sorts}" SelectedItem="{Binding SelectedSort}"
|
||||
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Sort}" AutomationProperties.Name="{l:Loc Library.Sort}" />
|
||||
</DockPanel>
|
||||
|
||||
<!-- Grid view: virtualised, recycling card grid. -->
|
||||
<ListBox x:Name="CardGrid" Grid.Row="1" Style="{StaticResource ListBox.Cards}" ItemsSource="{Binding Items}" ItemContainerStyle="{StaticResource ListBoxItem.LibraryCard}"
|
||||
Visibility="{Binding IsGrid, Converter={StaticResource BoolToVisibility}}" AutomationProperties.Name="{l:Loc Shell.Nav.Library}"
|
||||
ScrollViewer.ScrollChanged="OnScrollChanged">
|
||||
<ListBox.InputBindings>
|
||||
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding OpenCommand}" />
|
||||
<KeyBinding Key="Enter" Command="{Binding OpenCommand}" />
|
||||
</ListBox.InputBindings>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type lib:SequenceItem}">
|
||||
<v:SequenceCard Title="{Binding Title}" Subtitle="{Binding Subtitle}" Statuses="{Binding Statuses}" Thumbnail="{Binding Thumbnail}"
|
||||
ScrubSource="{Binding ScrubSource}" lib:ThumbnailLoading.Width="236"
|
||||
IsSelected="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}, Mode=TwoWay}"
|
||||
SelectToolTip="{l:Loc Tooltips.Library.Select}" ToolTip="{l:Loc Tooltips.Library.Card}">
|
||||
<v:SequenceCard.ActionsContent>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Style="{StaticResource Button.Icon}" Width="28" Height="28" MinWidth="28" ui:ButtonIcon.Glyph="{StaticResource Icon.Sequence}"
|
||||
Command="{Binding DataContext.OpenItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Open}" AutomationProperties.Name="{l:Loc Library.Action.Open}" Margin="0,0,6,0" />
|
||||
<Button Style="{StaticResource Button.Icon}" Width="28" Height="28" MinWidth="28" ui:ButtonIcon.Glyph="{StaticResource Icon.Analyse}"
|
||||
Command="{Binding DataContext.AnalyseItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Analyse}" AutomationProperties.Name="{l:Loc Library.Action.Analyse}" />
|
||||
</StackPanel>
|
||||
</v:SequenceCard.ActionsContent>
|
||||
</v:SequenceCard>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<!-- List view: virtualised table with sortable headers. -->
|
||||
<Border Grid.Row="1" Style="{StaticResource Border.Panel}" Margin="20,4,20,12" Visibility="{Binding IsList, Converter={StaticResource BoolToVisibility}}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border BorderBrush="{DynamicResource Brush.Stroke}" BorderThickness="0,0,0,1" Padding="14,2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MinWidth="180" />
|
||||
<ColumnDefinition Width="110" />
|
||||
<ColumnDefinition Width="170" />
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="90" />
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="90" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Sequence}" Command="{Binding SortByCommand}" CommandParameter="Title" ToolTip="{l:Loc Tooltips.Library.SortTitle}" />
|
||||
<Button Grid.Column="1" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Date}" Command="{Binding SortByCommand}" CommandParameter="Date" ToolTip="{l:Loc Tooltips.Library.SortDate}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Camera}" Margin="10,0,0,0" />
|
||||
<Button Grid.Column="3" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Frames}" HorizontalContentAlignment="Right" Command="{Binding SortByCommand}" CommandParameter="FrameCount" ToolTip="{l:Loc Tooltips.Library.SortFrames}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="4" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Span}" TextAlignment="Right" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="5" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Interval}" TextAlignment="Right" Margin="10,0,0,0" />
|
||||
<Button Grid.Column="6" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Size}" HorizontalContentAlignment="Right" Command="{Binding SortByCommand}" CommandParameter="Size" ToolTip="{l:Loc Tooltips.Library.SortSize}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="7" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.State}" Margin="16,0,0,0" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<ListBox x:Name="RowList" Grid.Row="1" ItemsSource="{Binding Items}" ItemContainerStyle="{StaticResource ListBoxItem.LibraryRow}" SelectionMode="Extended"
|
||||
VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" VirtualizingPanel.ScrollUnit="Pixel"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.ScrollChanged="OnScrollChanged" AutomationProperties.Name="{l:Loc Shell.Nav.Library}">
|
||||
<ListBox.InputBindings>
|
||||
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding OpenCommand}" />
|
||||
<KeyBinding Key="Enter" Command="{Binding OpenCommand}" />
|
||||
</ListBox.InputBindings>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type lib:SequenceItem}">
|
||||
<Grid ToolTip="{l:Loc Tooltips.Library.Row}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MinWidth="180" />
|
||||
<ColumnDefinition Width="110" />
|
||||
<ColumnDefinition Width="170" />
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="90" />
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="90" />
|
||||
<ColumnDefinition Width="150" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Style="{StaticResource Text.Cell}" Text="{Binding Title}" />
|
||||
<TextBlock Grid.Column="1" Style="{StaticResource Text.Cell}" Text="{Binding DateText}" Margin="10,0,0,0" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource Text.Cell}" Text="{Binding Camera}" Margin="10,0,0,0" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<TextBlock Grid.Column="3" Style="{StaticResource Text.CellNumber}" Text="{Binding FramesText}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="4" Style="{StaticResource Text.CellNumber}" Text="{Binding SpanText}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="5" Style="{StaticResource Text.CellNumber}" Text="{Binding IntervalText}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="6" Style="{StaticResource Text.CellNumber}" Text="{Binding SizeText}" Margin="10,0,0,0" />
|
||||
<ItemsControl Grid.Column="7" Margin="16,0,0,0" ItemsSource="{Binding Statuses}" ItemTemplate="{StaticResource Template.Status}"
|
||||
ItemsPanel="{StaticResource Panel.Row}" VerticalAlignment="Center" Focusable="False" ClipToBounds="True" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<!-- Toolbar (Main.html): search, filters, sort · saved views, layout switch, rescan. The search box gives way first. -->
|
||||
<Grid Grid.ColumnSpan="2" Margin="20,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MinWidth="140" MaxWidth="260" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox VerticalAlignment="Center" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" ui:Field.Glyph="{StaticResource Icon.Search}"
|
||||
ui:Field.Placeholder="{l:Loc Library.Search}" ToolTip="{l:Loc Tooltips.Library.Search}" AutomationProperties.Name="{l:Loc Library.Search}" />
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Years}" SelectedItem="{Binding SelectedYear}" Tag="{Binding IsYearFiltered}"
|
||||
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Year}" AutomationProperties.Name="{l:Loc Library.Filter.Year}" />
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" MaxWidth="170" ItemsSource="{Binding Cameras}" SelectedItem="{Binding SelectedCamera}"
|
||||
Tag="{Binding IsCameraFiltered}" ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Camera}"
|
||||
AutomationProperties.Name="{l:Loc Library.Filter.Camera}" />
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Statuses}" SelectedItem="{Binding SelectedStatus}" Tag="{Binding IsStatusFiltered}"
|
||||
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Status}" AutomationProperties.Name="{l:Loc Library.Filter.Status}" />
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" MaxWidth="170" ItemsSource="{Binding Tags}" SelectedItem="{Binding SelectedTag}" Tag="{Binding IsTagFiltered}"
|
||||
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Tags}" AutomationProperties.Name="{l:Loc Library.Filter.Tags}" />
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Origins}" SelectedItem="{Binding SelectedOrigin}" Tag="{Binding IsOriginFiltered}"
|
||||
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Origin}" AutomationProperties.Name="{l:Loc Library.Filter.Origin}"
|
||||
Visibility="{Binding ShowsOrigin, Converter={StaticResource BoolToVisibility}}" />
|
||||
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Sorts}" SelectedItem="{Binding SelectedSort}"
|
||||
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Sort}" AutomationProperties.Name="{l:Loc Library.Sort}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center" Margin="10,0,0,0">
|
||||
<Button x:Name="ViewsButton" Click="OnOpenMenu" ui:ButtonIcon.Glyph="{StaticResource Icon.Filter}" ToolTip="{Binding ViewsToolTip}"
|
||||
AutomationProperties.Name="{l:Loc Library.Views}" Margin="0,0,10,0">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource Button.Icon}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsViewActive}" Value="True">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource Brush.Accent}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="{l:Loc Library.Views.Apply}" ItemsSource="{Binding ViewChoices}" ItemContainerStyle="{StaticResource MenuItem.View}"
|
||||
IsEnabled="{Binding HasViews}" ToolTip="{l:Loc Tooltips.Library.ViewsApply}" ToolTipService.ShowOnDisabled="True" />
|
||||
<Separator />
|
||||
<MenuItem Header="{l:Loc Library.Views.SaveMenu}" Command="{Binding SaveViewCommand}" ToolTip="{l:Loc Tooltips.Library.ViewSave}" ToolTipService.ShowOnDisabled="True" />
|
||||
<MenuItem Header="{l:Loc Library.Views.RenameMenu}" Command="{Binding RenameViewCommand}" ToolTip="{l:Loc Tooltips.Library.ViewRename}"
|
||||
ToolTipService.ShowOnDisabled="True" />
|
||||
<MenuItem Header="{l:Loc Library.Views.Delete}" Command="{Binding DeleteViewCommand}" ToolTip="{l:Loc Tooltips.Library.ViewDelete}"
|
||||
ToolTipService.ShowOnDisabled="True" />
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
</Button>
|
||||
<v:SegmentedControl SelectedIndex="{Binding LayoutIndex, Mode=TwoWay}" AutomationProperties.Name="{l:Loc Library.View}">
|
||||
<v:SegmentedItem Glyph="{StaticResource Icon.ViewGrid}" ToolTip="{l:Loc Tooltips.Library.Grid}" AutomationProperties.Name="{l:Loc Library.View.Grid}" />
|
||||
<v:SegmentedItem Glyph="{StaticResource Icon.ViewList}" ToolTip="{l:Loc Tooltips.Library.List}" AutomationProperties.Name="{l:Loc Library.View.List}" />
|
||||
<v:SegmentedItem Glyph="{StaticResource Icon.ViewTimeline}" ToolTip="{l:Loc Tooltips.Library.Timeline}" AutomationProperties.Name="{l:Loc Library.View.Timeline}" />
|
||||
</v:SegmentedControl>
|
||||
<Button Style="{StaticResource Button.Icon}" ui:ButtonIcon.Glyph="{StaticResource Icon.Refresh}" Command="{Binding RescanCommand}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Rescan}" AutomationProperties.Name="{l:Loc Library.Rescan}" Margin="10,0,0,0" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Empty states: one sentence plus the first actions (Components.html). -->
|
||||
<ui:EmptyState Grid.Row="1" Message="{l:Loc Library.Empty}" Visibility="{Binding IsLibraryEmpty, Converter={StaticResource BoolToVisibility}}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Library.Empty.ImportCard}" Command="{Binding ImportCardCommand}" ToolTip="{l:Loc Tooltips.Library.ImportCard}" Margin="0,0,8,0" />
|
||||
<Button Content="{l:Loc Library.Empty.Adopt}" Command="{Binding AdoptFolderCommand}" ToolTip="{l:Loc Tooltips.Library.Adopt}" Margin="0,0,8,0" />
|
||||
<Button Content="{l:Loc Library.Empty.Connect}" Command="{Binding ConnectCommand}" ToolTip="{l:Loc Tooltips.Library.Connect}" />
|
||||
</StackPanel>
|
||||
</ui:EmptyState>
|
||||
<ui:EmptyState Grid.Row="1" Message="{l:Loc Library.NoMatch}" Visibility="{Binding IsNoMatch, Converter={StaticResource BoolToVisibility}}">
|
||||
<Button Content="{l:Loc Library.ClearFilters}" Command="{Binding ClearFiltersCommand}" ToolTip="{l:Loc Tooltips.Library.ClearFilters}" />
|
||||
</ui:EmptyState>
|
||||
<!-- Timeline: one band per year, photos per month; a month narrows to its year and scrolls the grid to it. -->
|
||||
<Border Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource Border.Panel}" Margin="20,4,20,8" Padding="14,8"
|
||||
Visibility="{Binding IsTimeline, Converter={StaticResource BoolToVisibility}}">
|
||||
<ScrollViewer MaxHeight="172" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Focusable="False">
|
||||
<v:TimelineBands x:Name="Timeline" Bands="{Binding TimelineBands}" SlotLabels="{Binding MonthLabels}" BandHeight="56"
|
||||
CurrentBand="{Binding TimelineBand, Mode=OneWay}" CurrentSlot="{Binding TimelineSlot, Mode=OneWay}" ValueFormatter="{Binding CountFormatter}"
|
||||
SlotActivated="OnSlotActivated" ToolTip="{l:Loc Tooltips.Library.TimelineBands}" AutomationProperties.Name="{l:Loc Library.View.Timeline}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
||||
<!-- Selection panel (320 px, DESIGN §3). -->
|
||||
<Border Grid.Row="1" Grid.Column="1" Width="320" Margin="0,4,20,12" Style="{StaticResource Border.Panel}" Padding="16"
|
||||
Visibility="{Binding HasSelection, Converter={StaticResource BoolToVisibility}}">
|
||||
<Grid>
|
||||
<!-- One sequence -->
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Focusable="False" DataContext="{Binding Selected}"
|
||||
Visibility="{Binding DataContext.IsSingleSelection, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource BoolToVisibility}}">
|
||||
<!-- Grid view (also under the timeline): virtualised, recycling card grid. -->
|
||||
<ListBox x:Name="CardGrid" Grid.Row="2" Style="{StaticResource ListBox.Cards}" ItemsSource="{Binding Items}" ItemContainerStyle="{StaticResource ListBoxItem.LibraryCard}"
|
||||
Visibility="{Binding IsGrid, Converter={StaticResource BoolToVisibility}}" AutomationProperties.Name="{l:Loc Shell.Nav.Library}"
|
||||
ScrollViewer.ScrollChanged="OnScrollChanged">
|
||||
<ListBox.InputBindings>
|
||||
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding OpenCommand}" />
|
||||
<KeyBinding Key="Enter" Command="{Binding OpenCommand}" />
|
||||
</ListBox.InputBindings>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type lib:SequenceItem}">
|
||||
<v:SequenceCard Title="{Binding Title}" Subtitle="{Binding Subtitle}" Statuses="{Binding Statuses}" Thumbnail="{Binding Thumbnail}"
|
||||
ScrubSource="{Binding ScrubSource}" lib:ThumbnailLoading.Width="236"
|
||||
IsSelected="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}, Mode=TwoWay}"
|
||||
SelectToolTip="{l:Loc Tooltips.Library.Select}" ToolTip="{l:Loc Tooltips.Library.Card}">
|
||||
<v:SequenceCard.ActionsContent>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Style="{StaticResource Button.Quick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Sequence}"
|
||||
Command="{Binding DataContext.OpenItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Open}" AutomationProperties.Name="{l:Loc Library.Action.Open}" />
|
||||
<Button Style="{StaticResource Button.Quick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Analyse}"
|
||||
Command="{Binding DataContext.AnalyseItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Analyse}" AutomationProperties.Name="{l:Loc Library.Action.Analyse}" />
|
||||
<Button Style="{StaticResource Button.Quick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Render}"
|
||||
Command="{Binding DataContext.RenderItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
|
||||
ToolTip="{Binding RenderToolTip}" AutomationProperties.Name="{l:Loc Library.Action.Render}" />
|
||||
<Button Style="{StaticResource Button.Quick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Sync}"
|
||||
Command="{Binding DataContext.SyncItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
|
||||
ToolTip="{Binding SyncToolTip}" AutomationProperties.Name="{l:Loc Library.Action.Sync}" />
|
||||
</StackPanel>
|
||||
</v:SequenceCard.ActionsContent>
|
||||
</v:SequenceCard>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<!-- List view: virtualised table with sortable headers; columns share the width, row actions appear on the hovered row. -->
|
||||
<Border Grid.Row="2" Grid.ColumnSpan="2" Style="{StaticResource Border.Panel}" Margin="20,4,20,12" Visibility="{Binding IsList, Converter={StaticResource BoolToVisibility}}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border BorderBrush="{DynamicResource Brush.Stroke}" BorderThickness="0,0,0,1" Padding="14,2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*" MinWidth="160" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="*" MinWidth="100" />
|
||||
<ColumnDefinition Width="72" />
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="64" />
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="*" MinWidth="120" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Sequence}" Command="{Binding SortByCommand}" CommandParameter="Title" ToolTip="{l:Loc Tooltips.Library.SortTitle}" />
|
||||
<Button Grid.Column="1" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Date}" Command="{Binding SortByCommand}" CommandParameter="Date" ToolTip="{l:Loc Tooltips.Library.SortDate}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Camera}" Margin="10,0,0,0" />
|
||||
<Button Grid.Column="3" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Frames}" HorizontalContentAlignment="Right" Command="{Binding SortByCommand}" CommandParameter="FrameCount" ToolTip="{l:Loc Tooltips.Library.SortFrames}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="4" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Span}" TextAlignment="Right" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="5" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Interval}" TextAlignment="Right" Margin="10,0,0,0" />
|
||||
<Button Grid.Column="6" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Size}" HorizontalContentAlignment="Right" Command="{Binding SortByCommand}" CommandParameter="Size" ToolTip="{l:Loc Tooltips.Library.SortSize}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="7" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.State}" Margin="16,0,0,0" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<ListBox x:Name="RowList" Grid.Row="1" ItemsSource="{Binding Items}" ItemContainerStyle="{StaticResource ListBoxItem.LibraryRow}" SelectionMode="Extended"
|
||||
VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" VirtualizingPanel.ScrollUnit="Pixel"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.ScrollChanged="OnScrollChanged" AutomationProperties.Name="{l:Loc Shell.Nav.Library}">
|
||||
<ListBox.InputBindings>
|
||||
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding OpenCommand}" />
|
||||
<KeyBinding Key="Enter" Command="{Binding OpenCommand}" />
|
||||
</ListBox.InputBindings>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type lib:SequenceItem}">
|
||||
<Grid ToolTip="{l:Loc Tooltips.Library.Row}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*" MinWidth="160" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="*" MinWidth="100" />
|
||||
<ColumnDefinition Width="72" />
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="64" />
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="*" MinWidth="120" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Style="{StaticResource Text.Cell}" Text="{Binding Title}" />
|
||||
<TextBlock Grid.Column="1" Style="{StaticResource Text.Cell}" Text="{Binding DateText}" Margin="10,0,0,0" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource Text.Cell}" Text="{Binding Camera}" Margin="10,0,0,0" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<TextBlock Grid.Column="3" Style="{StaticResource Text.CellNumber}" Text="{Binding FramesText}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="4" Style="{StaticResource Text.CellNumber}" Text="{Binding SpanText}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="5" Style="{StaticResource Text.CellNumber}" Text="{Binding IntervalText}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="6" Style="{StaticResource Text.CellNumber}" Text="{Binding SizeText}" Margin="10,0,0,0" />
|
||||
<ItemsControl Grid.Column="7" Margin="16,0,0,0" ItemsSource="{Binding Statuses}" ItemTemplate="{StaticResource Template.Status}"
|
||||
ItemsPanel="{StaticResource Panel.Row}" VerticalAlignment="Center" Focusable="False" ClipToBounds="True" />
|
||||
<Border Grid.Column="7" HorizontalAlignment="Right" Background="{DynamicResource Brush.Card}" Padding="6,0,0,0"
|
||||
Visibility="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType=ListBoxItem}, Converter={StaticResource BoolToVisibility}}">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<Button Style="{StaticResource Button.RowQuick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Sequence}"
|
||||
Command="{Binding DataContext.OpenItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Open}" AutomationProperties.Name="{l:Loc Library.Action.Open}" />
|
||||
<Button Style="{StaticResource Button.RowQuick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Analyse}"
|
||||
Command="{Binding DataContext.AnalyseItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Analyse}" AutomationProperties.Name="{l:Loc Library.Action.Analyse}" />
|
||||
<Button Style="{StaticResource Button.RowQuick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Render}"
|
||||
Command="{Binding DataContext.RenderItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
|
||||
ToolTip="{Binding RenderToolTip}" AutomationProperties.Name="{l:Loc Library.Action.Render}" />
|
||||
<Button Style="{StaticResource Button.RowQuick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Sync}"
|
||||
Command="{Binding DataContext.SyncItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
|
||||
ToolTip="{Binding SyncToolTip}" AutomationProperties.Name="{l:Loc Library.Action.Sync}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Empty states: one sentence plus the first actions (Components.html). -->
|
||||
<ui:EmptyState Grid.Row="2" Grid.ColumnSpan="2" Message="{l:Loc Library.Empty}" Visibility="{Binding IsLibraryEmpty, Converter={StaticResource BoolToVisibility}}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Library.Empty.ImportCard}" Command="{Binding ImportCardCommand}" ToolTip="{l:Loc Tooltips.Library.ImportCard}" Margin="0,0,8,0" />
|
||||
<Button Content="{l:Loc Library.Empty.Adopt}" Command="{Binding AdoptFolderCommand}" ToolTip="{l:Loc Tooltips.Library.Adopt}" Margin="0,0,8,0" />
|
||||
<Button Content="{l:Loc Library.Empty.Connect}" Command="{Binding ConnectCommand}" ToolTip="{l:Loc Tooltips.Library.Connect}" />
|
||||
</StackPanel>
|
||||
</ui:EmptyState>
|
||||
<ui:EmptyState Grid.Row="2" Grid.ColumnSpan="2" Message="{l:Loc Library.NoMatch}" Visibility="{Binding IsNoMatch, Converter={StaticResource BoolToVisibility}}">
|
||||
<Button Content="{l:Loc Library.ClearFilters}" Command="{Binding ClearFiltersCommand}" ToolTip="{l:Loc Tooltips.Library.ClearFilters}" />
|
||||
</ui:EmptyState>
|
||||
|
||||
<!-- One sequence selected in the grid or the timeline: its details (320 px, DESIGN §3). -->
|
||||
<Border Grid.Row="2" Grid.Column="1" Width="320" Margin="0,4,20,12" Style="{StaticResource Border.Panel}" Padding="16"
|
||||
Visibility="{Binding ShowsDetails, Converter={StaticResource BoolToVisibility}}">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Focusable="False" DataContext="{Binding Selected}">
|
||||
<StackPanel>
|
||||
<v:AspectRatioDecorator>
|
||||
<Border CornerRadius="6" Background="{DynamicResource Brush.Preview}">
|
||||
@@ -225,31 +355,53 @@
|
||||
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Library.Action.Open}" HorizontalAlignment="Stretch" Margin="0,18,0,0"
|
||||
Command="{Binding DataContext.OpenCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" ToolTip="{l:Loc Tooltips.Library.Open}" />
|
||||
<WrapPanel Margin="0,8,0,0">
|
||||
<Button Content="{l:Loc Library.Action.Analyse}" Command="{Binding DataContext.AnalyseCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Analyse}" ui:ButtonIcon.Glyph="{StaticResource Icon.Analyse}" Margin="0,0,8,8" />
|
||||
<Button Content="{l:Loc Library.Action.Proxies}" Command="{Binding DataContext.ProxiesCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Proxies}" ui:ButtonIcon.Glyph="{StaticResource Icon.Layers}" Margin="0,0,8,8" />
|
||||
<Button Content="{l:Loc Library.Action.Verify}" Command="{Binding DataContext.VerifyCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Verify}" ui:ButtonIcon.Glyph="{StaticResource Icon.Verify}" Margin="0,0,8,8" />
|
||||
<Button Content="{l:Loc Library.Action.Render}" Command="{Binding DataContext.RenderItemCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
CommandParameter="{Binding}" ToolTip="{Binding RenderToolTip}" ui:ButtonIcon.Glyph="{StaticResource Icon.Render}" Margin="0,0,8,8" />
|
||||
<Button Content="{l:Loc Library.Action.Folder}" Command="{Binding DataContext.RevealCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
ToolTip="{l:Loc Tooltips.Library.Folder}" ui:ButtonIcon.Glyph="{StaticResource Icon.FolderOpen}" Margin="0,0,8,8" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
||||
<!-- Several sequences: mass actions. -->
|
||||
<StackPanel Visibility="{Binding IsMultiSelection, Converter={StaticResource BoolToVisibility}}">
|
||||
<TextBlock Text="{Binding SelectionTitle}" Style="{StaticResource Text.Title}" />
|
||||
<TextBlock Text="{Binding SelectionSummary}" Style="{StaticResource Text.Secondary}" Margin="0,4,0,0" />
|
||||
<WrapPanel Margin="0,16,0,0">
|
||||
<Button Content="{l:Loc Library.Action.Analyse}" Command="{Binding AnalyseCommand}" ToolTip="{l:Loc Tooltips.Library.AnalyseAll}" ui:ButtonIcon.Glyph="{StaticResource Icon.Analyse}" Margin="0,0,8,8" />
|
||||
<Button Content="{l:Loc Library.Action.Proxies}" Command="{Binding ProxiesCommand}" ToolTip="{l:Loc Tooltips.Library.ProxiesAll}" ui:ButtonIcon.Glyph="{StaticResource Icon.Layers}" Margin="0,0,8,8" />
|
||||
<Button Content="{l:Loc Library.Action.Verify}" Command="{Binding VerifyCommand}" ToolTip="{l:Loc Tooltips.Library.VerifyAll}" ui:ButtonIcon.Glyph="{StaticResource Icon.Verify}" Margin="0,0,8,8" />
|
||||
<Button Content="{l:Loc Library.Action.ExportList}" Command="{Binding ExportListCommand}" ToolTip="{l:Loc Tooltips.Library.ExportList}" ui:ButtonIcon.Glyph="{StaticResource Icon.Export}" Margin="0,0,8,8" />
|
||||
</WrapPanel>
|
||||
<Button Style="{StaticResource Button.Subtle}" Content="{l:Loc Library.Action.ClearSelection}" Command="{Binding ClearSelectionCommand}" ToolTip="{l:Loc Tooltips.Library.ClearSelection}" HorizontalAlignment="Left" Margin="0,8,0,0" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!-- Mass actions bar on the selection (BRIEF §12.2): each button disabled with its reason when it cannot run on it. -->
|
||||
<Border Grid.Row="3" Grid.ColumnSpan="2" Style="{StaticResource Border.Panel}" Padding="14,8,6,0" Margin="20,0,20,12" MinHeight="48"
|
||||
Visibility="{Binding HasSelection, Converter={StaticResource BoolToVisibility}}">
|
||||
<WrapPanel VerticalAlignment="Center">
|
||||
<TextBlock Text="{Binding SelectionTitle}" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,8,8" Typography.NumeralAlignment="Tabular" />
|
||||
<TextBlock Text="{Binding SelectionSummary}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" Margin="0,0,12,8"
|
||||
Typography.NumeralAlignment="Tabular" />
|
||||
<Border Width="1" Height="22" Background="{DynamicResource Brush.Stroke}" Margin="0,0,12,8" />
|
||||
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Analyse}" Command="{Binding AnalyseCommand}" ToolTip="{Binding AnalyseToolTip}" />
|
||||
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Proxies}" Command="{Binding ProxiesCommand}" ToolTip="{Binding ProxiesToolTip}" />
|
||||
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Verify}" Command="{Binding VerifyCommand}" ToolTip="{Binding VerifyToolTip}" />
|
||||
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Tag}" Command="{Binding TagCommand}" ToolTip="{Binding TagToolTip}" />
|
||||
<Button Style="{StaticResource Button.Bar}" Click="OnOpenMenu" IsEnabled="{Binding CanRate}" ToolTip="{Binding RateToolTip}" AutomationProperties.Name="{l:Loc Library.Action.Rate}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{l:Loc Library.Action.Rate}" />
|
||||
<ui:Icon Glyph="{StaticResource Icon.ChevronDown}" Margin="6,0,0,0" />
|
||||
</StackPanel>
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding RatingChoices}" ItemContainerStyle="{StaticResource MenuItem.Rating}" />
|
||||
</Button.ContextMenu>
|
||||
</Button>
|
||||
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Move}" Command="{Binding MoveCommand}" ToolTip="{Binding MoveToolTip}" />
|
||||
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Upload}" Command="{Binding UploadCommand}" ToolTip="{Binding UploadToolTip}" />
|
||||
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Download}" Command="{Binding DownloadCommand}" ToolTip="{Binding DownloadToolTip}" />
|
||||
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.ExportList}" Command="{Binding ExportListCommand}" ToolTip="{Binding ExportListToolTip}" />
|
||||
<Button Style="{StaticResource Button.Destructive}" Height="30" Margin="0,0,8,8" Content="{l:Loc Library.Action.Delete}" Command="{Binding DeleteCommand}"
|
||||
ToolTip="{Binding DeleteToolTip}" />
|
||||
<Button Style="{StaticResource Button.Subtle}" Height="30" Margin="0,0,8,8" Content="{l:Loc Library.Action.ClearSelection}" Command="{Binding ClearSelectionCommand}"
|
||||
ToolTip="{l:Loc Tooltips.Library.ClearSelection}" />
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- In-window dialogs (tags, move, view name) over a scrim; the keyboard stays inside the dialog. -->
|
||||
<Grid Visibility="{Binding IsDialogOpen, Converter={StaticResource BoolToVisibility}}" KeyboardNavigation.TabNavigation="Cycle"
|
||||
KeyboardNavigation.ControlTabNavigation="Cycle" KeyboardNavigation.DirectionalNavigation="Contained">
|
||||
<Border Background="{DynamicResource Brush.Scrim}" />
|
||||
<ContentPresenter x:Name="DialogHost" Content="{Binding Dialog}" Margin="20" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,15 +1,65 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
using Titano.App.Library;
|
||||
using Titano.Ui.Visuals;
|
||||
|
||||
namespace Titano.App.Sections;
|
||||
|
||||
public partial class LibraryView : UserControl
|
||||
{
|
||||
public LibraryView() => InitializeComponent();
|
||||
public LibraryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContextChanged += OnDataContextChanged;
|
||||
}
|
||||
|
||||
private LibraryViewModel? Model => DataContext as LibraryViewModel;
|
||||
|
||||
/// <summary>Loads the next page when the grid or the list scrolls within two screens of its end.</summary>
|
||||
private void OnScrollChanged(object sender, ScrollChangedEventArgs e)
|
||||
{
|
||||
if (DataContext is not LibraryViewModel vm || e.ExtentHeight <= 0) return;
|
||||
if (Model is not { } vm || e.ExtentHeight <= 0) return;
|
||||
if (e.VerticalOffset + e.ViewportHeight >= e.ExtentHeight - 2 * Math.Max(e.ViewportHeight, 200)) _ = vm.LoadMoreAsync();
|
||||
}
|
||||
|
||||
/// <summary>A month of the timeline: the Library narrows to its year and the grid scrolls to it.</summary>
|
||||
private void OnSlotActivated(object sender, ChartItemEventArgs e) => Model?.ShowMonth(e.Row, e.Column);
|
||||
|
||||
/// <summary>"Saved views" and "Rate ▾" open their menu under themselves.</summary>
|
||||
private void OnOpenMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is not Button { ContextMenu: { } menu } button) return;
|
||||
menu.DataContext = DataContext;
|
||||
menu.PlacementTarget = button;
|
||||
menu.Placement = PlacementMode.Bottom;
|
||||
menu.IsOpen = true;
|
||||
}
|
||||
|
||||
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.OldValue is LibraryViewModel old)
|
||||
{
|
||||
old.ScrollRequested -= OnScrollRequested;
|
||||
old.PropertyChanged -= OnModelChanged;
|
||||
}
|
||||
if (e.NewValue is LibraryViewModel model)
|
||||
{
|
||||
model.ScrollRequested += OnScrollRequested;
|
||||
model.PropertyChanged += OnModelChanged;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnScrollRequested(SequenceItem item) =>
|
||||
Dispatcher.BeginInvoke(DispatcherPriority.Loaded, () => CardGrid.ScrollIntoView(item));
|
||||
|
||||
/// <summary>A dialog that opens takes the keyboard: its first field or button.</summary>
|
||||
private void OnModelChanged(object? sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName != nameof(LibraryViewModel.Dialog) || Model?.Dialog is null || !IsVisible) return;
|
||||
Dispatcher.BeginInvoke(DispatcherPriority.Input, () => DialogHost.MoveFocus(new TraversalRequest(FocusNavigationDirection.First)));
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user