repair manager project
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
using Microsoft.Win32;
|
||||
using Pilz.UI.Gtk.Symbols;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace ModpackUpdater.Apps;
|
||||
|
||||
public static class AppGlobals
|
||||
{
|
||||
public static IGtkSymbolFactory<AppSymbols> Symbols { get; } = new AppSymbolFactory();
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
if (UsesWindowsDarkTheme())
|
||||
Environment.SetEnvironmentVariable("GTK_THEME", "Adwaita:dark");
|
||||
|
||||
//RadFlyoutBase.ConfirmSvg = Symbols.GetSvgImage(AppSymbols.checkmark, Pilz.UI.Symbols.SymbolSize.Small);
|
||||
//RadFlyoutBase.CancelSvg = Symbols.GetSvgImage(AppSymbols.cancel, Pilz.UI.Symbols.SymbolSize.Small);
|
||||
}
|
||||
|
||||
private static bool UsesWindowsDarkTheme()
|
||||
{
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
try
|
||||
{
|
||||
return Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize")?.GetValue("AppsUseLightTheme") as bool? ?? default;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
return default;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using Pilz.UI.Gtk.Symbols;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ModpackUpdater.Apps;
|
||||
|
||||
internal class AppSymbolFactory : GtkSymbolFactory<AppSymbols>
|
||||
{
|
||||
public override Assembly GetImageResourceAssembly()
|
||||
{
|
||||
return Assembly.GetExecutingAssembly();
|
||||
}
|
||||
|
||||
public override string GetImageRessourcePath(AppSymbols svgImage)
|
||||
{
|
||||
return $"{GetType().Namespace}.Symbols.{svgImage}.svg";
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Pilz.UI.Gtk" Version="1.0.1" />
|
||||
<PackageReference Include="Pilz.UI" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user