From c076e9ef980403baa8021c64c65b0bfcf711fcbf Mon Sep 17 00:00:00 2001 From: Alan Fitton Date: Wed, 21 Sep 2011 11:22:01 +0000 Subject: on win32, set a GTK theme called win32-gtkrc.rc in the directory of the executable. the default GTK theme is *ugly* on windows, the MS-Windows one is less ugly.. --- src/main.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 3f79971..eda8d23 100644 --- a/src/main.c +++ b/src/main.c @@ -94,12 +94,15 @@ static gboolean should_be_minimised(int argc, char *argv[]) int main(int argc, char *argv[]) { int returnValue = EXIT_SUCCESS; + TrgMainWindow *window; + TrgClient *client; #ifdef HAVE_LIBUNIQUE UniqueApp *app = NULL; gboolean withUnique; #endif - TrgMainWindow *window; - TrgClient *client; +#ifdef WIN32 + gchar *packagedir, *gtkrcfile; +#endif #ifdef DEBUG //GMemVTable gmvt = {malloc,realloc,free,calloc,malloc,realloc}; @@ -110,6 +113,18 @@ int main(int argc, char *argv[]) g_type_init(); g_thread_init(NULL); + +#ifdef WIN32 + packagedir = g_win32_get_package_installation_directory_of_module(NULL); + gtkrcfile = g_build_filename(packagedir, "win32-gtkrc.rc", NULL); + + if (g_file_test(gtkrcfile, G_FILE_TEST_IS_REGULAR)) + gtk_rc_add_default_file(gtkrcfile); + + g_free(packagedir); + g_free(gtkrcfile); +#endif + gtk_init(&argc, &argv); g_set_application_name (PACKAGE_NAME); -- cgit v1.2.3