ui: migrate client back to WinForms

-> let's use wine for comatibility again
-> easier to maintain
-> easier to build dynamic options with
This commit is contained in:
2025-06-29 20:03:02 +02:00
parent 6e8b4f0a9d
commit 433613e43d
26 changed files with 2592 additions and 704 deletions

View File

@@ -0,0 +1,24 @@
using ModpackUpdater.Apps.Manager;
using Pilz.UI.WinForms.Telerik.Dialogs;
using Pilz.UI.WinForms.Telerik.Symbols;
using Pilz.UI.WinForms.Telerik.Theming;
using Telerik.WinControls.Themes;
namespace ModpackUpdater.Apps;
public static class AppGlobals
{
public static IRadSymbolFactory<AppSymbols> Symbols { get; } = new AppSymbolFactory();
public static void Initialize()
{
ThemeHelper.ApplyApplicationTheme(new ThemeDefinition(ApplicationTheme.Auto, HighContrastMode.Auto), n => n.Theme switch
{
ApplicationTheme.Light => new Windows11CompactTheme(),
ApplicationTheme.Gray or ApplicationTheme.Dark => new Windows11CompactDarkTheme(),
_ => throw new NotImplementedException(),
});
RadFlyoutBase.ConfirmSvg = Symbols.GetSvgImage(AppSymbols.checkmark, Pilz.UI.Symbols.SymbolSize.Small);
RadFlyoutBase.CancelSvg = Symbols.GetSvgImage(AppSymbols.cancel, Pilz.UI.Symbols.SymbolSize.Small);
}
}

View File

@@ -0,0 +1,17 @@
using Pilz.UI.WinForms.Telerik.Symbols;
using System.Reflection;
namespace ModpackUpdater.Apps.Manager;
internal class AppSymbolFactory : RadSymbolFactory<AppSymbols>
{
public override Assembly GetImageResourceAssembly()
{
return typeof(AppSymbols).Assembly;
}
public override string GetImageRessourcePath(AppSymbols svgImage)
{
return $"{typeof(AppSymbols).Namespace}.Symbols.{svgImage}.svg";
}
}

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
@@ -12,6 +12,9 @@
<ItemGroup>
<PackageReference Include="Pilz.UI" Version="3.0.0" />
<PackageReference Include="Pilz.UI.WinForms.Telerik.Symbols" Version="1.2.1" />
<PackageReference Include="UI.for.WinForms.Common" Version="2025.2.612-preview" />
<PackageReference Include="UI.for.WinForms.Themes" Version="2025.2.612-preview" />
</ItemGroup>
</Project>