LANCommander/LANCommander.Launcher/Views/DownloadQueuePageView.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

130 lines
6.8 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:LANCommander.Launcher.ViewModels"
xmlns:components="using:LANCommander.Launcher.Views.Components"
x:Class="LANCommander.Launcher.Views.DownloadQueuePageView"
x:DataType="vm:DownloadQueueViewModel">
<Grid RowDefinitions="Auto,*">
<!-- Header -->
<Border Grid.Row="0"
Padding="16,52,16,12"
Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}">
<DockPanel>
<Button DockPanel.Dock="Left"
Command="{Binding BackCommand}"
Background="Transparent"
BorderThickness="0"
Padding="8,4"
Margin="0,0,12,0"
VerticalAlignment="Center"
ToolTip.Tip="Back">
<TextBlock Text="&#x2190;" FontSize="16" VerticalAlignment="Center" />
</Button>
<Button DockPanel.Dock="Right"
Content="Clear completed"
Command="{Binding ClearCompletedCommand}"
Background="Transparent"
Padding="10,4"
VerticalAlignment="Center"
IsVisible="{Binding HasCompletedItems}" />
<StackPanel VerticalAlignment="Center">
<TextBlock Text="Downloads" FontSize="20" FontWeight="Bold" />
<TextBlock Text="{Binding ActiveCount, StringFormat='{}{0} active'}"
FontSize="12" Opacity="0.7"
IsVisible="{Binding HasActiveDownload}" />
</StackPanel>
</DockPanel>
</Border>
<!-- Content -->
<Panel Grid.Row="1">
<!-- Empty state -->
<StackPanel Spacing="12"
HorizontalAlignment="Center"
VerticalAlignment="Center"
IsVisible="{Binding !HasItems}">
<Icon Type="Regular" Value="DownloadSimple" Width="32" Height="32" HorizontalAlignment="Center" />
<TextBlock Text="Empty Queue" FontSize="16" Opacity="0.5" HorizontalAlignment="Center" />
<TextBlock Text="Install a game from the Depot to see it here."
FontSize="13" Opacity="0.4" HorizontalAlignment="Center" />
</StackPanel>
<!-- Queue list -->
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"
IsVisible="{Binding HasItems}">
<StackPanel Margin="16,12,16,16" Spacing="0">
<!-- IN PROGRESS -->
<TextBlock Text="IN PROGRESS"
FontSize="11" FontWeight="SemiBold"
LetterSpacing="1"
Foreground="{DynamicResource TextSecondaryBrush}"
Margin="0,0,0,8"
IsVisible="{Binding HasActiveDownload}" />
<ItemsControl ItemsSource="{Binding QueueItems}"
IsVisible="{Binding HasActiveDownload}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:InstallQueueItemViewModel">
<components:DownloadQueueItemView
IsVisible="{Binding IsActive}"
ToggleExpandedCommand="{Binding $parent[ItemsControl].((vm:DownloadQueueViewModel)DataContext).ToggleItemExpandedCommand}"
CancelCommand="{Binding $parent[ItemsControl].((vm:DownloadQueueViewModel)DataContext).CancelCommand}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!-- NEXT UP -->
<TextBlock Text="NEXT UP"
FontSize="11" FontWeight="SemiBold"
LetterSpacing="1"
Foreground="{DynamicResource TextSecondaryBrush}"
Margin="0,12,0,8"
IsVisible="{Binding HasQueuedItems}" />
<ItemsControl ItemsSource="{Binding QueueItems}"
IsVisible="{Binding HasQueuedItems}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:InstallQueueItemViewModel">
<components:DownloadQueueItemView
IsVisible="{Binding IsQueued}"
ToggleExpandedCommand="{Binding $parent[ItemsControl].((vm:DownloadQueueViewModel)DataContext).ToggleItemExpandedCommand}"
RemoveCommand="{Binding $parent[ItemsControl].((vm:DownloadQueueViewModel)DataContext).RemoveCommand}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!-- COMPLETED -->
<TextBlock Text="COMPLETED"
FontSize="11" FontWeight="SemiBold"
LetterSpacing="1"
Foreground="{DynamicResource TextSecondaryBrush}"
Margin="0,12,0,8"
IsVisible="{Binding HasCompletedItems}" />
<ItemsControl ItemsSource="{Binding QueueItems}"
IsVisible="{Binding HasCompletedItems}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:InstallQueueItemViewModel">
<components:DownloadQueueItemView
IsVisible="{Binding IsCompleted}"
ToggleExpandedCommand="{Binding $parent[ItemsControl].((vm:DownloadQueueViewModel)DataContext).ToggleItemExpandedCommand}"
ViewInLibraryCommand="{Binding $parent[ItemsControl].((vm:DownloadQueueViewModel)DataContext).ViewInLibraryCommand}"
PlayCommand="{Binding $parent[ItemsControl].((vm:DownloadQueueViewModel)DataContext).PlayCommand}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
</Panel>
</Grid>
</UserControl>