Files
minecraft-modpack-updater/ModpackUpdater.Apps.Client.Gui/MainForm.axaml
2025-11-06 07:42:44 +01:00

127 lines
4.9 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:svg="clr-namespace:Avalonia.Svg;assembly=Avalonia.Svg"
mc:Ignorable="d"
x:Class="ModpackUpdater.Apps.Client.Gui.MainForm"
SizeToContent="WidthAndHeight"
Title="Minecraft Modpack Updater"
Icon="/Assets/app.ico"
>
<Grid
RowDefinitions="Auto,Auto,Auto,Auto,Auto"
Margin="3, 3, 3, 3"
RowSpacing="6"
ColumnSpacing="6"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*" MinWidth="300"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Labels -->
<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Content="Minecraft profile:" />
<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Content="Modpack config url:" />
<Label Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" IsVisible="false" x:Name="LabelInstallKey" Content="Installation key:" />
<Label Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Content="Status:" />
<Label Grid.Row="3" Grid.Column="1" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<Image Width="16" Height="16" x:Name="ImageStatus" />
<TextBlock Margin="3, 0, 0, 0" x:Name="TextStatus" />
</StackPanel>
</Label>
<!-- TextBoxes: Profile -->
<TextBox
x:Name="TextBoxMinecraftProfileFolder"
Grid.Row="0"
Grid.Column="1"
VerticalAlignment="Center"
Watermark="C:\..."
TextInput="TextBoxMinecraftProfileFolder_TextInserted"
/>
<!-- TextBoxes: ModpackConfig -->
<TextBox
x:Name="TextBoxModpackConfig"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
VerticalAlignment="Center"
Watermark="https://..."
TextInput="TextBoxModpackConfig_TextInserted"
/>
<!-- TextBoxes: InstallKey -->
<TextBox
x:Name="TextBoxInstallKey"
Grid.Row="2"
Grid.Column="1"
Grid.ColumnSpan="2"
VerticalAlignment="Center"
Watermark="XXXXX-YYYYY-ZZZZZ-AAAAA-BBBBB"
TextInput="TextBoxInstallKey_TextInserted"
IsVisible="false"
/>
<!-- Button: SearchProfileFolder -->
<Button
Grid.Row="0"
Grid.Column="2"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Click="ButtonSearchProfileFolder_Click"
>
<StackPanel Orientation="Horizontal">
<Image VerticalAlignment="Center" Width="16" Height="16" x:Name="ButtonImageSearchProfileFolder" />
<TextBlock VerticalAlignment="Center" Margin="3, 0, 0, 0">Search</TextBlock>
</StackPanel>
</Button>
<!-- Button: CheckForUpdates -->
<Button
Grid.Row="4"
Grid.Column="1"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" x:Name="ButtonCheckForUpdates" Click="ButtonCheckForUpdates_Click"
>
<StackPanel Orientation="Horizontal">
<Image VerticalAlignment="Center" Width="16" Height="16" x:Name="ButtonImageCheckForUpdates" />
<TextBlock VerticalAlignment="Center" Margin="3, 0, 0, 0">Check for updates</TextBlock>
</StackPanel>
</Button>
<!-- Button: Install -->
<SplitButton
Grid.Row="4"
Grid.Column="2"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
x:Name="ButtonInstall"
Click="ButtonInstall_Click"
>
<StackPanel Orientation="Horizontal">
<Image VerticalAlignment="Center" Width="16" Height="16" x:Name="ButtonImageInstall" />
<TextBlock VerticalAlignment="Center" Margin="3, 0, 0, 0">Install</TextBlock>
</StackPanel>
<SplitButton.Flyout>
<MenuFlyout>
<MenuItem Header="Repair" Click="MenuItemRepair_Click">
<MenuItem.Icon>
<Image Width="16" Height="16" x:Name="MenuItemImageRepair" />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</SplitButton.Flyout>
</SplitButton>
</Grid>
</Window>