206 lines
12 KiB
XML
206 lines
12 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="using:LANCommander.Launcher.ViewModels"
|
|
xmlns:controls="using:LANCommander.Launcher.Controls"
|
|
x:Class="LANCommander.Launcher.Views.InstallOptionsOverlay"
|
|
x:DataType="vm:InstallOptionsViewModel"
|
|
controls:AutoFocus.IsEnabled="True">
|
|
|
|
<UserControl.Styles>
|
|
<!-- Addon toggle button: looks like a list row -->
|
|
<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="0" />
|
|
</Style>
|
|
<Style Selector="ToggleButton.AddonItem:checked">
|
|
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumBrush}" />
|
|
</Style>
|
|
</UserControl.Styles>
|
|
|
|
<!-- Full-window dim backdrop -->
|
|
<Grid Background="#AA000000">
|
|
|
|
<!-- Centered card -->
|
|
<Border Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}"
|
|
Width="460"
|
|
MaxHeight="600"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
BoxShadow="0 8 40 8 #88000000">
|
|
|
|
<StackPanel Spacing="0">
|
|
|
|
<!-- ── Header ─────────────────────────────────────────────── -->
|
|
<Border Padding="20,16,20,0">
|
|
<TextBlock FontSize="18" FontWeight="Bold"
|
|
HorizontalAlignment="Center"
|
|
TextTrimming="CharacterEllipsis"
|
|
Text="{Binding DialogTitle}" />
|
|
</Border>
|
|
|
|
<!-- ── Size info ─────────────────────────────────────────── -->
|
|
<Border IsVisible="{Binding HasSizeInfo}"
|
|
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>
|
|
|
|
<!-- ── Tools ──────────────────────────────────────────────── -->
|
|
<Border IsVisible="{Binding HasTools}"
|
|
Padding="20,16,20,0">
|
|
<StackPanel Spacing="8">
|
|
<DockPanel>
|
|
<Button DockPanel.Dock="Right"
|
|
Content="None"
|
|
Background="Transparent"
|
|
Padding="8,2"
|
|
FontSize="12"
|
|
Click="DeselectAllTools_Click" />
|
|
<Button DockPanel.Dock="Right"
|
|
Content="All"
|
|
Background="Transparent"
|
|
Padding="8,2"
|
|
FontSize="12"
|
|
Margin="0,0,4,0"
|
|
Click="SelectAllTools_Click" />
|
|
<TextBlock Text="Optional Tools"
|
|
FontSize="13" FontWeight="SemiBold"
|
|
VerticalAlignment="Center" />
|
|
</DockPanel>
|
|
|
|
<ScrollViewer MaxHeight="280"
|
|
HorizontalScrollBarVisibility="Disabled"
|
|
VerticalScrollBarVisibility="Auto">
|
|
<ItemsControl ItemsSource="{Binding Tools}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="vm:InstallToolItemViewModel">
|
|
<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 Text="{Binding Title}"
|
|
FontSize="13"
|
|
VerticalAlignment="Center"
|
|
TextTrimming="CharacterEllipsis" />
|
|
</DockPanel>
|
|
</ToggleButton>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- ── Install directory ──────────────────────────────────── -->
|
|
<Border IsVisible="{Binding ShowInstallDirectory}"
|
|
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="{Binding ConfirmButtonText}"
|
|
Classes="Primary"
|
|
Click="Confirm_Click" />
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
</UserControl>
|