Hardcode Gtk theme settings for Windows
authorSam Thursfield <samthursfield@codethink.co.uk>
Thu, 19 May 2011 14:20:24 +0000 (15:20 +0100)
committerSam Thursfield <samthursfield@codethink.co.uk>
Fri, 20 May 2011 14:00:02 +0000 (15:00 +0100)
This avoids packaging a gtkrc file which has no real benefit when
being used inside a single-application sandbox prefix.

src/moonshot-window.vala

index c24cae9..7ade76a 100644 (file)
@@ -651,6 +651,14 @@ class MainWindow : Window
     {
         Gtk.init(ref args);
 
+#if OS_WIN32
+        // Force specific theme settings on Windows without requiring a gtkrc file
+        Gtk.Settings settings = Gtk.Settings.get_default ();
+        settings.set_string_property ("gtk-theme-name", "ms-windows", "moonshot");
+        settings.set_string_property ("gtk-icon-theme-name", "Gnome", "moonshot");
+        settings.set_long_property ("gtk-menu-images", 0, "moonshot");
+#endif
+
         Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
         Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
         Intl.textdomain (Config.GETTEXT_PACKAGE);