ui(client): improvements
This commit is contained in:
13
.idea/.idea.ModpackUpdater/.idea/.gitignore
generated
vendored
Normal file
13
.idea/.idea.ModpackUpdater/.idea/.gitignore
generated
vendored
Normal 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
1
.idea/.idea.ModpackUpdater/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
ModpackUpdater
|
||||
21
.idea/.idea.ModpackUpdater/.idea/avalonia.xml
generated
Normal file
21
.idea/.idea.ModpackUpdater/.idea/avalonia.xml
generated
Normal 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>
|
||||
4
.idea/.idea.ModpackUpdater/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.ModpackUpdater/.idea/encodings.xml
generated
Normal 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>
|
||||
8
.idea/.idea.ModpackUpdater/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.ModpackUpdater/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.ModpackUpdater/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.ModpackUpdater/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -4,7 +4,7 @@
|
||||
RequestedThemeVariant="Default">
|
||||
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
|
||||
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
</Application.Styles>
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -3,7 +3,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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"
|
||||
x:Class="ModpackUpdater.Apps.Client.Gui.MainForm"
|
||||
SizeToContent="WidthAndHeight"
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<Grid
|
||||
RowDefinitions="Auto,Auto,Auto,Auto,Auto"
|
||||
Margin="3, 3, 3, 3"
|
||||
Margin="3"
|
||||
RowSpacing="6"
|
||||
ColumnSpacing="6"
|
||||
HorizontalAlignment="Stretch"
|
||||
@@ -27,10 +27,10 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Labels -->
|
||||
<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="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="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="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="1" VerticalAlignment="Center">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Width="16" Height="16" x:Name="ImageStatus" />
|
||||
@@ -72,56 +72,43 @@
|
||||
/>
|
||||
|
||||
<!-- Button: SearchProfileFolder -->
|
||||
<Button
|
||||
<pilz:ImageButton
|
||||
x:Name="ButtonSearchProfileFolder"
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center"
|
||||
Text="{x:Static lang:GeneralLangRes.Select}"
|
||||
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
|
||||
<pilz:ImageButton
|
||||
x:Name="ButtonCheckForUpdates"
|
||||
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" Text="{x:Static lang:GeneralLangRes.CheckForUpdates}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="{x:Static lang:GeneralLangRes.CheckForUpdates}"
|
||||
Click="ButtonCheckForUpdates_Click"
|
||||
/>
|
||||
|
||||
<!-- Button: Install -->
|
||||
<SplitButton
|
||||
<pilz:ImageSplitButton
|
||||
x:Name="ButtonInstall"
|
||||
Grid.Row="4"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center"
|
||||
x:Name="ButtonInstall"
|
||||
Text="{x:Static lang:GeneralLangRes.Install}"
|
||||
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>
|
||||
<MenuFlyout>
|
||||
<MenuItem Header="{x:Static lang:GeneralLangRes.Repair}" Click="MenuItemRepair_Click">
|
||||
<MenuItem.Icon>
|
||||
<Image Width="16" Height="16" x:Name="MenuItemImageRepair" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="MenuItemRepair" Header="{x:Static lang:GeneralLangRes.Repair}" Click="MenuItemRepair_Click" />
|
||||
</MenuFlyout>
|
||||
</SplitButton.Flyout>
|
||||
</SplitButton>
|
||||
</pilz:ImageSplitButton>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -11,6 +11,7 @@ using Pilz.SymbolPacks.Sets;
|
||||
using Pilz.UI.AvaloniaUI.Symbols;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using Pilz.UI.Symbols;
|
||||
|
||||
namespace ModpackUpdater.Apps.Client.Gui;
|
||||
|
||||
@@ -34,10 +35,10 @@ public partial class MainForm : Window
|
||||
Closing += MainForm_Closing;
|
||||
Loaded += MainForm_Loaded;
|
||||
|
||||
ButtonImageSearchProfileFolder.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.opened_folder);
|
||||
ButtonImageCheckForUpdates.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.update);
|
||||
ButtonImageInstall.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer);
|
||||
MenuItemImageRepair.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.wrench);
|
||||
ButtonSearchProfileFolder.ImageSource = Symbols.Fluent.GetImageSource(SymbolsFluent.opened_folder);
|
||||
ButtonCheckForUpdates.ImageSource = Symbols.Fluent.GetImageSource(SymbolsFluent.update);
|
||||
ButtonInstall.ImageSource = Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer);
|
||||
MenuItemRepair.Icon = Symbols.Fluent.GetImage(SymbolsFluent.wrench, SymbolSize.Small);
|
||||
|
||||
ClearStatus();
|
||||
LoadProfileToUi();
|
||||
@@ -115,7 +116,7 @@ public partial class MainForm : Window
|
||||
ButtonInstall.IsEnabled = 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));
|
||||
ButtonCheckForUpdates.IsEnabled = false;
|
||||
@@ -271,7 +272,6 @@ public partial class MainForm : Window
|
||||
//Application.Restart(); // FIXME
|
||||
return;
|
||||
}
|
||||
|
||||
CheckStatusAndUpdate(true);
|
||||
}
|
||||
|
||||
@@ -314,20 +314,20 @@ public partial class MainForm : Window
|
||||
|
||||
private async void ButtonInstall_Click(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!currentUpdating)
|
||||
{
|
||||
ClearStatus();
|
||||
await ExecuteUpdate(true, false);
|
||||
}
|
||||
if (currentUpdating)
|
||||
return;
|
||||
|
||||
ClearStatus();
|
||||
await ExecuteUpdate(true, false);
|
||||
}
|
||||
|
||||
private async void MenuItemRepair_Click(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!currentUpdating)
|
||||
{
|
||||
ClearStatus();
|
||||
await ExecuteUpdate(true, true);
|
||||
}
|
||||
if (currentUpdating)
|
||||
return;
|
||||
|
||||
ClearStatus();
|
||||
await ExecuteUpdate(true, true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -61,7 +62,7 @@
|
||||
<PackageReference Include="Pilz.Cryptography" Version="2.1.2" />
|
||||
<PackageReference Include="Pilz.IO" Version="2.1.0" />
|
||||
<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="Avalonia" Version="11.3.8" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.3.8" />
|
||||
|
||||
Reference in New Issue
Block a user