From c75de30765354343369b02fbacf5eec1c2242da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Wed, 27 Oct 2021 07:45:43 +0200 Subject: [PATCH] sdgui: create and install a program icon --- CMakeLists.txt | 2 ++ sdgui.desktop | 1 + sdgui.svg | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/sdgui.c | 5 +++++ 4 files changed, 59 insertions(+) create mode 100644 sdgui.svg diff --git a/CMakeLists.txt b/CMakeLists.txt index b76df12..6080d32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,6 +229,8 @@ if (NOT WIN32) if (WITH_GUI) install (TARGETS sdgui DESTINATION ${CMAKE_INSTALL_BINDIR}) + install (FILES sdgui.svg + DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) install (FILES sdgui.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install (FILES sdgui.xml diff --git a/sdgui.desktop b/sdgui.desktop index 38b8ee2..da5fcc6 100644 --- a/sdgui.desktop +++ b/sdgui.desktop @@ -2,6 +2,7 @@ Type=Application Name=sdgui GenericName=StarDict GUI +Icon=sdgui Exec=sdgui %F StartupNotify=true MimeType=application/x-stardict-ifo; diff --git a/sdgui.svg b/sdgui.svg new file mode 100644 index 0000000..7808bd9 --- /dev/null +++ b/sdgui.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/sdgui.c b/src/sdgui.c index d58efb1..b175ceb 100644 --- a/src/sdgui.c +++ b/src/sdgui.c @@ -27,6 +27,9 @@ #include "utils.h" #include "stardict-view.h" +#undef PROJECT_NAME +#define PROJECT_NAME "sdgui" + static struct { GtkWidget *window; ///< Top-level window @@ -385,6 +388,8 @@ main (int argc, char *argv[]) return 1; } + gtk_window_set_default_icon_name (PROJECT_NAME); + g.dictionaries = g_ptr_array_new_with_free_func ((GDestroyNotify) dictionary_destroy); if (filenames)