Use custom gtk theme when compiling and running on widows
This commit is contained in:
@@ -14,6 +14,10 @@
|
|||||||
<EmbeddedResource Include="Icons\icon.png">
|
<EmbeddedResource Include="Icons\icon.png">
|
||||||
<LogicalName>%(Filename)%(Extension)</LogicalName>
|
<LogicalName>%(Filename)%(Extension)</LogicalName>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
||||||
|
<Content Include="Theme\**\*" Condition="$(NETCoreSdkRuntimeIdentifier) == 'win-x64'">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -27,6 +31,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Dialogs\Glade" />
|
<Folder Include="Dialogs\Glade" />
|
||||||
|
<Folder Include="Theme" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
namespace EstusShots.Gtk
|
namespace EstusShots.Gtk
|
||||||
@@ -10,6 +11,17 @@ namespace EstusShots.Gtk
|
|||||||
{
|
{
|
||||||
Application.Init();
|
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);
|
var app = new Application("EstusShots.Gtk", GLib.ApplicationFlags.None);
|
||||||
app.Register(GLib.Cancellable.Current);
|
app.Register(GLib.Cancellable.Current);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user