aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-10-27 07:45:43 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-10-27 09:46:17 +0200
commitc75de30765354343369b02fbacf5eec1c2242da6 (patch)
treea3375986051d2743845580b7d36c9b4417652188
parent451859e976027410b97fda3147c4543ff86a429b (diff)
downloadtdv-c75de30765354343369b02fbacf5eec1c2242da6.tar.gz
tdv-c75de30765354343369b02fbacf5eec1c2242da6.tar.xz
tdv-c75de30765354343369b02fbacf5eec1c2242da6.zip
sdgui: create and install a program icon
-rw-r--r--CMakeLists.txt2
-rw-r--r--sdgui.desktop1
-rw-r--r--sdgui.svg51
-rw-r--r--src/sdgui.c5
4 files changed, 59 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg version="1.1" width="48" height="48" viewBox="0 0 48 48"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ color-interpolation="linearRGB"
+ color-interpolation-filters="linearRGB">
+
+ <defs>
+ <rect id="text" width="13" height="3" fill="#d0d0d0" />
+ <filter id="shadow" x="-25%" y="-25%" width="150%" height="150%">
+ <feFlood flood-color="#000000" flood-opacity=".5" result="flood" />
+ <feComposite in="SourceGraphic" in2="flood" operator="in" />
+ <feGaussianBlur stdDeviation="1.25" />
+ <feOffset dx="1" dy="1" result="offset" />
+ <feComposite in="SourceGraphic" in2="offset" />
+ </filter>
+ <mask id="hole">
+ <rect x="-25%" y="-25%" width="150%" height="150%" fill="#ffffff" />
+ <circle r="10.5" />
+ </mask>
+ </defs>
+
+ <rect x="5" y="1" width="38" height="46" ry="2"
+ fill="#ffffff" stroke="#606060" stroke-width="1.25" />
+
+ <use xlink:href="#text" x="9" y="5" />
+ <use xlink:href="#text" x="9" y="10" />
+ <use xlink:href="#text" x="9" y="15" />
+ <use xlink:href="#text" x="9" y="20" />
+ <use xlink:href="#text" x="9" y="25" />
+ <use xlink:href="#text" x="9" y="30" />
+ <use xlink:href="#text" x="9" y="35" />
+ <use xlink:href="#text" x="9" y="40" />
+
+ <use xlink:href="#text" x="26" y="5" />
+ <use xlink:href="#text" x="26" y="10" />
+ <use xlink:href="#text" x="26" y="15" />
+ <use xlink:href="#text" x="26" y="20" />
+ <use xlink:href="#text" x="26" y="25" />
+ <use xlink:href="#text" x="26" y="30" />
+ <use xlink:href="#text" x="26" y="35" />
+ <use xlink:href="#text" x="26" y="40" />
+
+ <circle cx="21" cy="19" r="9" fill="#ffffff" fill-opacity=".5"
+ stroke-width="2" stroke="#000000" filter="url(#shadow)" />
+ <g filter="url(#shadow)">
+ <rect x="-1.75" y="0" width="3.5" height="22.5"
+ transform="translate(21 19) rotate(-30)" mask="url(#hole)" />
+ </g>
+</svg>
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)