LANCommander/LANCommander.Launcher/Views/DepotBrowseView.axaml
Pat Hartl b183e4b18c Remove old launcher, rename Avalonia launcher
Also adds ARM builds for Linux + Windows launcher
2026-06-06 05:49:24 -05:00

261 lines
14 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:LANCommander.Launcher.ViewModels"
xmlns:enums="using:LANCommander.Launcher.Settings.Enums"
xmlns:local="using:LANCommander.Launcher.Views"
x:Class="LANCommander.Launcher.Views.DepotBrowseView"
x:DataType="vm:DepotBrowseViewModel">
<UserControl.Styles>
<Style Selector="Button.active">
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}" />
</Style>
<!-- Locked filter chip: looks like an active tag but non-interactive (no hover change) -->
<Style Selector="Border.locked-chip">
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}" />
<Setter Property="CornerRadius" Value="4" />
<Setter Property="Padding" Value="8,4" />
</Style>
</UserControl.Styles>
<DockPanel>
<!-- ── Filter Bar ──────────────────────────────────────────────────── -->
<StackPanel DockPanel.Dock="Bottom"
Background="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}">
<!-- Advanced panel — expands upward above the quick row -->
<Border IsVisible="{Binding IsAdvancedFilterOpen}"
Padding="12,10,12,4"
BorderBrush="{DynamicResource SystemControlForegroundBaseLowBrush}"
BorderThickness="0,0,0,1">
<WrapPanel Orientation="Horizontal" ItemWidth="180">
<!-- Sort -->
<StackPanel Spacing="4" Margin="0,0,12,8">
<TextBlock Text="Sort" FontSize="11" Opacity="0.6" />
<Grid ColumnDefinitions="*,Auto">
<ComboBox Grid.Column="0"
SelectedItem="{Binding SelectedSortBy}"
HorizontalAlignment="Stretch">
<ComboBox.Items>
<enums:SortBy>Title</enums:SortBy>
<enums:SortBy>DateReleased</enums:SortBy>
</ComboBox.Items>
</ComboBox>
<Button Grid.Column="1"
Command="{Binding ToggleSortDirectionCommand}"
Padding="8,6" Margin="4,0,0,0">
<Panel>
<Icon Type="Regular" Value="ArrowUp" Width="12" Height="12" IsVisible="{Binding SortAscending}" />
<Icon Type="Regular" Value="ArrowDown" Width="12" Height="12" IsVisible="{Binding !SortAscending}" />
</Panel>
</Button>
</Grid>
</StackPanel>
<!-- Group by (hidden when collection is locked — grouping is implicit) -->
<StackPanel Spacing="4" Margin="0,0,12,8"
IsVisible="{Binding !IsCollectionLocked}">
<TextBlock Text="Group By" FontSize="11" Opacity="0.6" />
<ComboBox ItemsSource="{Binding AvailableGroupByOptions}"
SelectedItem="{Binding SelectedGroupBy}"
HorizontalAlignment="Stretch" />
</StackPanel>
<!-- Genre — hidden when genre is locked -->
<StackPanel Spacing="4" Margin="0,0,12,8"
IsVisible="{Binding !IsGenreLocked}">
<TextBlock Text="Genre" FontSize="11" Opacity="0.6" />
<ComboBox ItemsSource="{Binding AvailableGenres}"
SelectedItem="{Binding SelectedGenre}"
PlaceholderText="Any"
HorizontalAlignment="Stretch">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
<!-- Tags — hidden when tag is locked -->
<StackPanel Spacing="4" Margin="0,0,12,8"
IsVisible="{Binding !IsTagLocked}">
<TextBlock Text="Tag" FontSize="11" Opacity="0.6" />
<ComboBox ItemsSource="{Binding AvailableTags}"
SelectedItem="{Binding SelectedTag}"
PlaceholderText="Any"
HorizontalAlignment="Stretch" />
</StackPanel>
<!-- Developer -->
<StackPanel Spacing="4" Margin="0,0,12,8">
<TextBlock Text="Developer" FontSize="11" Opacity="0.6" />
<ComboBox ItemsSource="{Binding AvailableDevelopers}"
SelectedItem="{Binding SelectedDeveloper}"
PlaceholderText="Any"
HorizontalAlignment="Stretch" />
</StackPanel>
<!-- Publisher -->
<StackPanel Spacing="4" Margin="0,0,12,8">
<TextBlock Text="Publisher" FontSize="11" Opacity="0.6" />
<ComboBox ItemsSource="{Binding AvailablePublishers}"
SelectedItem="{Binding SelectedPublisher}"
PlaceholderText="Any"
HorizontalAlignment="Stretch" />
</StackPanel>
<!-- Multiplayer -->
<StackPanel Spacing="4" Margin="0,0,12,8">
<TextBlock Text="Multiplayer" FontSize="11" Opacity="0.6" />
<ComboBox ItemsSource="{x:Static vm:GamesCollectionViewModel.AvailableMultiplayerTypes}"
SelectedItem="{Binding SelectedMultiplayerType}"
PlaceholderText="Any"
HorizontalAlignment="Stretch" />
</StackPanel>
<!-- Player Count -->
<StackPanel Spacing="4" Margin="0,0,12,8">
<TextBlock Text="Min Players" FontSize="11" Opacity="0.6" />
<ComboBox ItemsSource="{x:Static vm:GamesCollectionViewModel.AvailablePlayerCounts}"
SelectedItem="{Binding SelectedMinPlayers}"
PlaceholderText="Any"
HorizontalAlignment="Stretch" />
</StackPanel>
<!-- In Library (depot only) -->
<StackPanel Spacing="4" Margin="0,0,12,8"
IsVisible="{Binding ShowInLibraryFilter}">
<TextBlock Text="Ownership" FontSize="11" Opacity="0.6" />
<ToggleButton IsChecked="{Binding ShowInLibraryOnly}"
Content="In Library Only"
HorizontalAlignment="Stretch" />
</StackPanel>
</WrapPanel>
</Border>
<!-- Quick row -->
<Border Padding="12,8">
<Grid ColumnDefinitions="Auto,Auto,*,Auto,Auto,Auto">
<!-- Back to Depot button (always visible on solid bar background) -->
<Button Grid.Column="0"
Command="{Binding GoBackCommand}"
Classes="Text"
Padding="8,6"
Margin="0,0,8,0">
<StackPanel Orientation="Horizontal" Spacing="6">
<Icon Type="Regular" Value="ArrowLeft" Width="13" Height="13" VerticalAlignment="Center" />
<TextBlock Text="Depot" VerticalAlignment="Center" />
</StackPanel>
</Button>
<!-- Locked filter chip — shown when navigated from genre/tag/collection -->
<Border Grid.Column="1"
Classes="locked-chip"
Margin="0,0,8,0"
IsVisible="{Binding HasLockedFilter}"
VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" Spacing="5">
<TextBlock Text="{Binding LockedFilterLabel}"
FontSize="11"
Opacity="0.7"
VerticalAlignment="Center" />
<TextBlock Text="{Binding LockedFilterValue}"
FontSize="12"
FontWeight="SemiBold"
VerticalAlignment="Center" />
<Icon Type="Regular" Value="Lock" Width="10" Height="10"
Opacity="0.7" VerticalAlignment="Center" />
</StackPanel>
</Border>
<TextBox Grid.Column="2"
Watermark="Search games..."
Text="{Binding SearchText}"
Margin="0,0,8,0" />
<!-- View type toggle -->
<Border Grid.Column="3"
CornerRadius="2"
Margin="0,0,8,0"
Padding="4"
Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}">
<StackPanel Orientation="Horizontal">
<Button Background="Transparent" BorderThickness="0" Padding="8,6"
ToolTip.Tip="Grid view"
Classes.active="{Binding IsGridView}"
Click="GridViewButton_Click">
<Icon Type="Regular" Value="SquaresFour" Width="14" Height="14" />
</Button>
<Button Background="Transparent" BorderThickness="0" Padding="8,6"
ToolTip.Tip="List view"
Classes.active="{Binding IsListView}"
Click="ListViewButton_Click">
<Icon Type="Regular" Value="Rows" Width="14" Height="14" />
</Button>
<Button Background="Transparent" BorderThickness="0" Padding="8,6"
ToolTip.Tip="Horizontal view"
Classes.active="{Binding IsHorizontalView}"
Click="HorizontalViewButton_Click">
<Icon Type="Regular" Value="ArrowsHorizontal" Width="14" Height="14" />
</Button>
</StackPanel>
</Border>
<!-- Advanced toggle -->
<ToggleButton Grid.Column="4"
Classes="Text"
IsChecked="{Binding IsAdvancedFilterOpen}"
Padding="8,6"
Margin="0,0,8,0"
ToolTip.Tip="Advanced filters">
<Icon Type="Regular" Value="FunnelSimple" Width="14" Height="14" />
</ToggleButton>
<!-- Clear button — uses ClearAdditionalFiltersCommand to preserve locked filter -->
<Button Grid.Column="5"
Command="{Binding ClearAdditionalFiltersCommand}"
Content="✕"
Classes="Text Error"
Padding="8,6" />
</Grid>
</Border>
</StackPanel>
<!-- ── Loading ─────────────────────────────────────────────────────── -->
<Border DockPanel.Dock="Top"
IsVisible="{Binding IsLoading}"
Padding="16,54,16,10"
HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal" Spacing="10" VerticalAlignment="Center">
<ProgressBar IsIndeterminate="True" Width="120" Height="3" />
<TextBlock Text="Loading..." VerticalAlignment="Center" Opacity="0.6" FontSize="13" />
</StackPanel>
</Border>
<!-- ── Error ──────────────────────────────────────────────────────── -->
<Border DockPanel.Dock="Top"
IsVisible="{Binding HasError}"
Padding="12"
Margin="16,44,16,0"
CornerRadius="0">
<TextBlock Text="{Binding StatusMessage}" TextWrapping="Wrap" Foreground="IndianRed" />
</Border>
<!-- ── Sub-views ──────────────────────────────────────────────────── -->
<Grid>
<local:GamesGridView IsVisible="{Binding IsGridViewFlat}" />
<local:GamesRowView IsVisible="{Binding IsListViewFlat}" />
<local:GamesShelfView IsVisible="{Binding IsHorizontalViewFlat}" />
<local:GamesGroupedView IsVisible="{Binding IsGrouped}" />
</Grid>
</DockPanel>
</UserControl>