summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-10-29 09:14:15 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-10-29 09:14:15 -0700
commit7f0c866f486eab549e25853bedd2e96b1b211773 (patch)
tree4c04e9415eaec48ad24e8f0a7ba866ceeab8758e /gtk-gui.c
parent2101f37c1b81840beda99a7b4e87e938f9e52a7a (diff)
downloadsubsurface-7f0c866f486eab549e25853bedd2e96b1b211773.tar.gz
Get icons working correctly under Windows
With this we are able to include both a separate .ico file that the program can load at runtime and a .res file (that is created from the .rc file, both in the packaging/windows directory) that is linked into the executable and makes the Windows Explorer show the correct icon for subsurface. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index ea3f646e7..b1bc82a73 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -552,7 +552,11 @@ static void about_dialog(GtkWidget *w, gpointer data)
GdkPixbuf *logo = NULL;
if (need_icon) {
+#ifndef WIN32
GtkWidget *image = gtk_image_new_from_file("subsurface.svg");
+#else
+ GtkWidget *image = gtk_image_new_from_file("subsurface.ico");
+#endif
if (image) {
logo = gtk_image_get_pixbuf(GTK_IMAGE(image));
@@ -823,7 +827,7 @@ void init_ui(int argc, char **argv)
#ifndef WIN32
gtk_window_set_icon_from_file(GTK_WINDOW(win), "subsurface.svg", NULL);
#else
- gtk_window_set_icon_from_file(GTK_WINDOW(win), "subsurface.bmp", NULL);
+ gtk_window_set_icon_from_file(GTK_WINDOW(win), "subsurface.ico", NULL);
#endif
g_signal_connect(G_OBJECT(win), "delete-event", G_CALLBACK(on_delete), NULL);
g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(on_destroy), NULL);