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

95 lines
5.2 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:LANCommander.Launcher.ViewModels"
xmlns:vmComponents="using:LANCommander.Launcher.ViewModels.Components"
xmlns:components="using:LANCommander.Launcher.Views.Components"
xmlns:controls="using:LANCommander.Launcher.Controls"
x:Class="LANCommander.Launcher.Views.GamesRowView"
x:DataType="vm:GamesCollectionViewModel"
controls:AutoFocus.IsEnabled="True">
<UserControl.Styles>
<Style Selector="ListBox.GamesList">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Padding" Value="0" />
</Style>
<Style Selector="ListBox.GamesList ListBoxItem">
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<ControlTemplate>
<ContentPresenter Name="PART_ContentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Padding="{TemplateBinding Padding}" />
</ControlTemplate>
</Setter>
</Style>
<Style Selector="ListBox.GamesList ListBoxItem">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Padding" Value="4,2" />
<Setter Property="Margin" Value="8,2" />
</Style>
<Style Selector="ListBox.GamesList ListBoxItem:pointerover Border.ListRowInner">
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumBrush}" />
</Style>
<Style Selector="ListBox.GamesList ListBoxItem:selected Border.ListRowInner">
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColor}" />
<Setter Property="BorderThickness" Value="2" />
</Style>
</UserControl.Styles>
<ListBox x:Name="GamesListBox"
Classes="GamesList TitlebarOffset"
ItemsSource="{Binding Games}"
SelectedItem="{Binding SelectedGame}"
Padding="0,56,0,0"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
Tapped="OnGameTapped"
KeyDown="OnListBoxKeyDown">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate DataType="vmComponents:GameItemViewModel">
<Border Classes="ListRowInner" Padding="8,6" CornerRadius="0"
Background="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}">
<DockPanel>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal"
Spacing="8" VerticalAlignment="Center">
<Border Background="#CC000000" CornerRadius="0"
Padding="4,2" IsVisible="{Binding ShowInLibraryBadge}">
<Icon Type="Regular" Value="Check" Width="10" Height="10" Color="White" />
</Border>
<TextBlock Text="{Binding ReleasedOn, StringFormat='{}{0:yyyy}'}"
FontSize="12" Opacity="0.55" VerticalAlignment="Center" />
</StackPanel>
<components:Cover Source="{Binding CoverPath}"
MimeType="{Binding CoverMimeType}"
Title="{Binding Title}"
Width="40" Height="55"
Margin="0,0,12,0" />
<StackPanel VerticalAlignment="Center" Spacing="2">
<TextBlock Text="{Binding Title}"
FontSize="14" FontWeight="SemiBold"
TextTrimming="CharacterEllipsis" />
<TextBlock Text="{Binding Genres}" FontSize="12" Opacity="0.6"
TextTrimming="CharacterEllipsis"
IsVisible="{Binding Genres, Converter={x:Static StringConverters.IsNotNullOrEmpty}}" />
</StackPanel>
</DockPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</UserControl>