sdgui: create and install a program icon

This commit is contained in:
Přemysl Eric Janouch 2021-10-27 07:45:43 +02:00
parent 451859e976
commit c75de30765
Signed by: p
GPG Key ID: A0420B94F92B9493
4 changed files with 59 additions and 0 deletions

View File

@ -229,6 +229,8 @@ if (NOT WIN32)
if (WITH_GUI) if (WITH_GUI)
install (TARGETS sdgui DESTINATION ${CMAKE_INSTALL_BINDIR}) install (TARGETS sdgui DESTINATION ${CMAKE_INSTALL_BINDIR})
install (FILES sdgui.svg
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
install (FILES sdgui.desktop install (FILES sdgui.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install (FILES sdgui.xml install (FILES sdgui.xml

View File

@ -2,6 +2,7 @@
Type=Application Type=Application
Name=sdgui Name=sdgui
GenericName=StarDict GUI GenericName=StarDict GUI
Icon=sdgui
Exec=sdgui %F Exec=sdgui %F
StartupNotify=true StartupNotify=true
MimeType=application/x-stardict-ifo; MimeType=application/x-stardict-ifo;

51
sdgui.svg Normal file
View File

@ -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>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -27,6 +27,9 @@
#include "utils.h" #include "utils.h"
#include "stardict-view.h" #include "stardict-view.h"
#undef PROJECT_NAME
#define PROJECT_NAME "sdgui"
static struct static struct
{ {
GtkWidget *window; ///< Top-level window GtkWidget *window; ///< Top-level window
@ -385,6 +388,8 @@ main (int argc, char *argv[])
return 1; return 1;
} }
gtk_window_set_default_icon_name (PROJECT_NAME);
g.dictionaries = g.dictionaries =
g_ptr_array_new_with_free_func ((GDestroyNotify) dictionary_destroy); g_ptr_array_new_with_free_func ((GDestroyNotify) dictionary_destroy);
if (filenames) if (filenames)