ui(client): improvements

This commit is contained in:
Pascal
2025-11-07 10:45:55 +01:00
parent 05b94a3189
commit b899d2ee7d
11 changed files with 95 additions and 54 deletions

13
.idea/.idea.ModpackUpdater/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/modules.xml
/projectSettingsUpdater.xml
/contentModel.xml
/.idea.ModpackUpdater.iml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

1
.idea/.idea.ModpackUpdater/.idea/.name generated Normal file
View File

@@ -0,0 +1 @@
ModpackUpdater

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AvaloniaProject">
<option name="projectPerEditor">
<map>
<entry key="ModpackUpdater.Apps.Client.Gui/App.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/Controls/ImageButton.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/Controls/ImageButton2.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/Controls/ImageButton3.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/Controls/TemplatedControl1.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/Controls/Test.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/MainForm.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/Resources1.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/Themes/Generic.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/Themes/Resources1.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/Themes/Styles.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
<entry key="ModpackUpdater.Apps.Client.Gui/Themes/Styles/ImageButton2.axaml" value="ModpackUpdater.Apps.Client.Gui/ModpackUpdater.Apps.Client.Gui.csproj" />
</map>
</option>
</component>
</project>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -4,7 +4,7 @@
RequestedThemeVariant="Default"> RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> <!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.Styles> <Application.Styles>
<FluentTheme /> <FluentTheme />
</Application.Styles> </Application.Styles>
</Application> </Application>

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lang="clr-namespace:ModpackUpdater.Apps.Client.Gui.LangRes" xmlns:lang="clr-namespace:ModpackUpdater.Apps.Client.Gui.LangRes"
xmlns:svg="clr-namespace:Avalonia.Svg;assembly=Avalonia.Svg" xmlns:pilz="https://git.pilzinsel64.de/pilz-framework/pilz"
mc:Ignorable="d" mc:Ignorable="d"
x:Class="ModpackUpdater.Apps.Client.Gui.MainForm" x:Class="ModpackUpdater.Apps.Client.Gui.MainForm"
SizeToContent="WidthAndHeight" SizeToContent="WidthAndHeight"
@@ -13,7 +13,7 @@
<Grid <Grid
RowDefinitions="Auto,Auto,Auto,Auto,Auto" RowDefinitions="Auto,Auto,Auto,Auto,Auto"
Margin="3, 3, 3, 3" Margin="3"
RowSpacing="6" RowSpacing="6"
ColumnSpacing="6" ColumnSpacing="6"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@@ -27,10 +27,10 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- Labels --> <!-- Labels -->
<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.MinecraftProfile}:" /> <Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.MinecraftProfile}" />
<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.ModpackConfigUrl}:" /> <Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.ModpackConfigUrl}" />
<Label Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" IsVisible="false" x:Name="LabelInstallKey" Content="{x:Static lang:GeneralLangRes.InstallationKey}:" /> <Label Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" IsVisible="false" x:Name="LabelInstallKey" Content="{x:Static lang:GeneralLangRes.InstallationKey}" />
<Label Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.Status}:" /> <Label Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" Content="{x:Static lang:GeneralLangRes.Status}" />
<Label Grid.Row="3" Grid.Column="1" VerticalAlignment="Center"> <Label Grid.Row="3" Grid.Column="1" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Image Width="16" Height="16" x:Name="ImageStatus" /> <Image Width="16" Height="16" x:Name="ImageStatus" />
@@ -72,56 +72,43 @@
/> />
<!-- Button: SearchProfileFolder --> <!-- Button: SearchProfileFolder -->
<Button <pilz:ImageButton
x:Name="ButtonSearchProfileFolder"
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center" Text="{x:Static lang:GeneralLangRes.Select}"
Click="ButtonSearchProfileFolder_Click" Click="ButtonSearchProfileFolder_Click"
> />
<StackPanel Orientation="Horizontal">
<Image VerticalAlignment="Center" Width="16" Height="16" x:Name="ButtonImageSearchProfileFolder" />
<TextBlock VerticalAlignment="Center" Margin="3, 0, 0, 0" Text="{x:Static lang:GeneralLangRes.Select}" />
</StackPanel>
</Button>
<!-- Button: CheckForUpdates --> <!-- Button: CheckForUpdates -->
<Button <pilz:ImageButton
x:Name="ButtonCheckForUpdates"
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" x:Name="ButtonCheckForUpdates" Click="ButtonCheckForUpdates_Click" HorizontalAlignment="Stretch"
> Text="{x:Static lang:GeneralLangRes.CheckForUpdates}"
<StackPanel Orientation="Horizontal"> Click="ButtonCheckForUpdates_Click"
<Image VerticalAlignment="Center" Width="16" Height="16" x:Name="ButtonImageCheckForUpdates" /> />
<TextBlock VerticalAlignment="Center" Margin="3, 0, 0, 0" Text="{x:Static lang:GeneralLangRes.CheckForUpdates}" />
</StackPanel>
</Button>
<!-- Button: Install --> <!-- Button: Install -->
<SplitButton <pilz:ImageSplitButton
x:Name="ButtonInstall"
Grid.Row="4" Grid.Row="4"
Grid.Column="2" Grid.Column="2"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center" HorizontalContentAlignment="Center"
x:Name="ButtonInstall" Text="{x:Static lang:GeneralLangRes.Install}"
Click="ButtonInstall_Click" Click="ButtonInstall_Click"
> >
<StackPanel Orientation="Horizontal">
<Image VerticalAlignment="Center" Width="16" Height="16" x:Name="ButtonImageInstall" />
<TextBlock VerticalAlignment="Center" Margin="3, 0, 0, 0" Text="{x:Static lang:GeneralLangRes.Install}" />
</StackPanel>
<SplitButton.Flyout> <SplitButton.Flyout>
<MenuFlyout> <MenuFlyout>
<MenuItem Header="{x:Static lang:GeneralLangRes.Repair}" Click="MenuItemRepair_Click"> <MenuItem x:Name="MenuItemRepair" Header="{x:Static lang:GeneralLangRes.Repair}" Click="MenuItemRepair_Click" />
<MenuItem.Icon>
<Image Width="16" Height="16" x:Name="MenuItemImageRepair" />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout> </MenuFlyout>
</SplitButton.Flyout> </SplitButton.Flyout>
</SplitButton> </pilz:ImageSplitButton>
</Grid> </Grid>
</Window> </Window>

View File

@@ -11,6 +11,7 @@ using Pilz.SymbolPacks.Sets;
using Pilz.UI.AvaloniaUI.Symbols; using Pilz.UI.AvaloniaUI.Symbols;
using System.Diagnostics; using System.Diagnostics;
using System.Reflection; using System.Reflection;
using Pilz.UI.Symbols;
namespace ModpackUpdater.Apps.Client.Gui; namespace ModpackUpdater.Apps.Client.Gui;
@@ -34,10 +35,10 @@ public partial class MainForm : Window
Closing += MainForm_Closing; Closing += MainForm_Closing;
Loaded += MainForm_Loaded; Loaded += MainForm_Loaded;
ButtonImageSearchProfileFolder.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.opened_folder); ButtonSearchProfileFolder.ImageSource = Symbols.Fluent.GetImageSource(SymbolsFluent.opened_folder);
ButtonImageCheckForUpdates.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.update); ButtonCheckForUpdates.ImageSource = Symbols.Fluent.GetImageSource(SymbolsFluent.update);
ButtonImageInstall.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer); ButtonInstall.ImageSource = Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer);
MenuItemImageRepair.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.wrench); MenuItemRepair.Icon = Symbols.Fluent.GetImage(SymbolsFluent.wrench, SymbolSize.Small);
ClearStatus(); ClearStatus();
LoadProfileToUi(); LoadProfileToUi();
@@ -115,7 +116,7 @@ public partial class MainForm : Window
ButtonInstall.IsEnabled = false; ButtonInstall.IsEnabled = false;
return false; return false;
} }
else if (updateConfig == null || string.IsNullOrWhiteSpace(TextBoxModpackConfig.Text)) else if (string.IsNullOrWhiteSpace(TextBoxModpackConfig.Text))
{ {
SetStatus(GeneralLangRes.ConfigIncompleteOrNotLoaded, Symbols.Fluent.GetImageSource(SymbolsFluent.warning_shield)); SetStatus(GeneralLangRes.ConfigIncompleteOrNotLoaded, Symbols.Fluent.GetImageSource(SymbolsFluent.warning_shield));
ButtonCheckForUpdates.IsEnabled = false; ButtonCheckForUpdates.IsEnabled = false;
@@ -271,7 +272,6 @@ public partial class MainForm : Window
//Application.Restart(); // FIXME //Application.Restart(); // FIXME
return; return;
} }
CheckStatusAndUpdate(true); CheckStatusAndUpdate(true);
} }
@@ -314,20 +314,20 @@ public partial class MainForm : Window
private async void ButtonInstall_Click(object? sender, RoutedEventArgs e) private async void ButtonInstall_Click(object? sender, RoutedEventArgs e)
{ {
if (!currentUpdating) if (currentUpdating)
{ return;
ClearStatus();
await ExecuteUpdate(true, false); ClearStatus();
} await ExecuteUpdate(true, false);
} }
private async void MenuItemRepair_Click(object? sender, RoutedEventArgs e) private async void MenuItemRepair_Click(object? sender, RoutedEventArgs e)
{ {
if (!currentUpdating) if (currentUpdating)
{ return;
ClearStatus();
await ExecuteUpdate(true, true); ClearStatus();
} await ExecuteUpdate(true, true);
} }
#endregion #endregion

View File

@@ -10,6 +10,7 @@
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract> <IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<LangVersion>latest</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -61,7 +62,7 @@
<PackageReference Include="Pilz.Cryptography" Version="2.1.2" /> <PackageReference Include="Pilz.Cryptography" Version="2.1.2" />
<PackageReference Include="Pilz.IO" Version="2.1.0" /> <PackageReference Include="Pilz.IO" Version="2.1.0" />
<PackageReference Include="Pilz.SymbolPacks.Fluent" Version="1.0.12" /> <PackageReference Include="Pilz.SymbolPacks.Fluent" Version="1.0.12" />
<PackageReference Include="Pilz.UI.AvaloniaUI" Version="1.0.0" /> <PackageReference Include="Pilz.UI.AvaloniaUI" Version="1.1.3" />
<PackageReference Include="Pilz.UI.AvaloniaUI.Symbols" Version="1.0.0" /> <PackageReference Include="Pilz.UI.AvaloniaUI.Symbols" Version="1.0.0" />
<PackageReference Include="Avalonia" Version="11.3.8" /> <PackageReference Include="Avalonia" Version="11.3.8" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.8" /> <PackageReference Include="Avalonia.Desktop" Version="11.3.8" />