LANCommander/LANCommander.Launcher/Views/InstallOptionsWindow.axaml
2026-06-20 04:24:20 -05:00

146 lines
7.5 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:LANCommander.Launcher.ViewModels"
x:Class="LANCommander.Launcher.Views.InstallOptionsWindow"
x:DataType="vm:InstallOptionsViewModel"
Title="Install Options"
Width="460"
SizeToContent="Height"
MinHeight="160"
MaxHeight="600"
WindowStartupLocation="CenterOwner"
CanResize="False">
<Window.Styles>
<Style Selector="ToggleButton.AddonItem">
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" />
<Setter Property="Padding" Value="10,8" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="CornerRadius" Value="6" />
</Style>
<Style Selector="ToggleButton.AddonItem:checked">
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumBrush}" />
</Style>
</Window.Styles>
<StackPanel Spacing="0">
<!-- ── Header ───────────────────────────────────────────────────── -->
<Border Padding="20,16,20,0">
<TextBlock FontSize="18" FontWeight="Bold"
HorizontalAlignment="Center"
TextTrimming="CharacterEllipsis">
<Run Text="Install " /><Run Text="{Binding GameTitle}" />
</TextBlock>
</Border>
<!-- ── Size info ────────────────────────────────────────────────── -->
<Border IsVisible="{Binding HasAddons}"
Padding="20,24,20,8">
<UniformGrid Columns="2">
<StackPanel HorizontalAlignment="Center">
<TextBlock Text="Download Size"
FontSize="11" Opacity="0.55"
HorizontalAlignment="Center" />
<TextBlock Text="{Binding DownloadSizeText}"
FontSize="18" FontWeight="SemiBold"
HorizontalAlignment="Center" />
</StackPanel>
<StackPanel HorizontalAlignment="Center">
<TextBlock Text="Space Required"
FontSize="11" Opacity="0.55"
HorizontalAlignment="Center" />
<TextBlock Text="{Binding SpaceRequiredText}"
FontSize="18" FontWeight="SemiBold"
HorizontalAlignment="Center" />
</StackPanel>
</UniformGrid>
</Border>
<!-- ── Addons ───────────────────────────────────────────────────── -->
<Border IsVisible="{Binding HasAddons}"
Padding="20,16,20,0">
<StackPanel Spacing="8">
<DockPanel>
<Button DockPanel.Dock="Right"
Content="None"
Background="Transparent"
Padding="8,2"
FontSize="12"
Click="DeselectAllAddons_Click" />
<Button DockPanel.Dock="Right"
Content="All"
Background="Transparent"
Padding="8,2"
FontSize="12"
Margin="0,0,4,0"
Click="SelectAllAddons_Click" />
<TextBlock Text="Optional Add-ons"
FontSize="13" FontWeight="SemiBold"
VerticalAlignment="Center" />
</DockPanel>
<ScrollViewer MaxHeight="280"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding Addons}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:InstallAddonItemViewModel">
<ToggleButton Classes="AddonItem"
IsChecked="{Binding IsSelected}"
Margin="0,0,0,3">
<DockPanel>
<Icon DockPanel.Dock="Left"
Type="Regular" Value="Check"
Width="12" Height="12"
IsVisible="{Binding IsSelected}"
Margin="0,0,10,0"
VerticalAlignment="Center" />
<TextBlock DockPanel.Dock="Right"
Text="{Binding TypeLabel}"
FontSize="11"
Opacity="0.55"
VerticalAlignment="Center" />
<TextBlock Text="{Binding Title}"
FontSize="13"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis" />
</DockPanel>
</ToggleButton>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</StackPanel>
</Border>
<!-- ── Install directory ────────────────────────────────────────── -->
<Border IsVisible="{Binding HasMultipleDirectories}"
Padding="20,16,20,0">
<StackPanel Spacing="8">
<TextBlock Text="Install Location"
FontSize="13" FontWeight="SemiBold" />
<ComboBox ItemsSource="{Binding InstallDirectories}"
SelectedItem="{Binding SelectedInstallDirectory}"
HorizontalAlignment="Stretch" />
</StackPanel>
</Border>
<!-- ── Buttons ──────────────────────────────────────────────────── -->
<Border Padding="20,16">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right"
Spacing="8"
Classes="DialogFooter">
<Button Content="Cancel"
Click="Cancel_Click" />
<Button Content="Install"
Classes="Primary"
Click="Confirm_Click" />
</StackPanel>
</Border>
</StackPanel>
</Window>