Skip to content

Commit

Permalink
gtk: add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Arisotura committed Dec 16, 2017
1 parent ca41ce6 commit 2e82a4f
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ obj
*.depend
*.layout
*.o
melon_grc.c
melon_grc.h
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ if (UNIX)
src/libui_sdl/libui/unix/text.c
src/libui_sdl/libui/unix/util.c
src/libui_sdl/libui/unix/window.c
melon_grc.c
)

FIND_PACKAGE(PkgConfig REQUIRED)
Expand All @@ -86,6 +87,10 @@ if (UNIX)
LINK_LIBRARIES(${GTK3_LIBRARIES})

ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER})

add_custom_command(OUTPUT melon_grc.c
COMMAND glib-compile-resources --generate-source melon_grc.xml
COMMAND glib-compile-resources --generate-header melon_grc.xml)

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
LINK_LIBRARIES("dl")
Expand Down
Binary file added icon/melon_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon/melon_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon/melon_256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon/melon_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon/melon_48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon/melon_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions melon_grc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/kuriboland/melonDS">
<file preprocess="to-pixdata">icon/melon_16x16.png</file>
<file preprocess="to-pixdata">icon/melon_32x32.png</file>
<file preprocess="to-pixdata">icon/melon_48x48.png</file>
<file preprocess="to-pixdata">icon/melon_64x64.png</file>
<file preprocess="to-pixdata">icon/melon_128x128.png</file>
<file preprocess="to-pixdata">icon/melon_256x256.png</file>
</gresource>
</gresources>
9 changes: 9 additions & 0 deletions src/libui_sdl/libui/unix/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ const char *uiInit(uiInitOptions *o)

gtkthread = g_thread_self();

GList* iconlist = NULL;
iconlist = g_list_append(iconlist, gdk_pixbuf_new_from_resource("/org/kuriboland/melonDS/icon/melon_16x16.png", NULL));
iconlist = g_list_append(iconlist, gdk_pixbuf_new_from_resource("/org/kuriboland/melonDS/icon/melon_32x32.png", NULL));
iconlist = g_list_append(iconlist, gdk_pixbuf_new_from_resource("/org/kuriboland/melonDS/icon/melon_48x48.png", NULL));
iconlist = g_list_append(iconlist, gdk_pixbuf_new_from_resource("/org/kuriboland/melonDS/icon/melon_64x64.png", NULL));
iconlist = g_list_append(iconlist, gdk_pixbuf_new_from_resource("/org/kuriboland/melonDS/icon/melon_128x128.png", NULL));

gtk_window_set_default_icon_list(iconlist);

return NULL;
}

Expand Down

0 comments on commit 2e82a4f

Please sign in to comment.