Use custom gtk theme when compiling and running on widows

This commit is contained in:
Marcel Fries
2020-03-16 14:40:56 +01:00
parent 42bca48742
commit b350cee2bc
2 changed files with 17 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Runtime.InteropServices;
using Gtk;
namespace EstusShots.Gtk
@@ -10,6 +11,17 @@ namespace EstusShots.Gtk
{
Application.Init();
// Load a custom theme only when running on windows
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
var provider = new CssProvider();
provider.LoadFromPath("Theme/gtk-3.20/gtk.css");
StyleContext.AddProviderForScreen(Gdk.Screen.Default, provider, 800);
// TODO ????
//IconTheme.Default.PrependSearchPath("Theme/icons/48x48");
}
var app = new Application("EstusShots.Gtk", GLib.ApplicationFlags.None);
app.Register(GLib.Cancellable.Current);