Add an icon and a desktop file

This commit is contained in:
Přemysl Eric Janouch 2021-09-16 17:34:28 +02:00
parent 913267724a
commit 440a9a9840
Signed by: p
GPG Key ID: A0420B94F92B9493
4 changed files with 62 additions and 2 deletions

View File

@ -77,6 +77,8 @@ main(int argc, char *argv[])
return 0;
}
gtk_window_set_default_icon_name(PROJECT_NAME);
GtkWidget *view = g_object_new(FASTIV_TYPE_VIEW, NULL);
GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);

11
fastiv.desktop Normal file
View File

@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Name=fastiv
GenericName=Image Viewer
Icon=fastiv
Exec=fastiv %F
Terminal=false
StartupNotify=true
Categories=Graphics;2DGraphics;Viewer;
# TODO(p): Figure out how to include RAW MIME types, if appropriate.
MimeType=image/png;image/bmp;image/x-bmp;image/x-MS-bmp;image/gif;image/jpeg;

43
fastiv.svg Normal file
View File

@ -0,0 +1,43 @@
<?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">
<defs>
<linearGradient id="base-background" x1="0" y1="0" x2="1" y2="1">
<stop stop-color="#ffffff" offset="0.1" />
<stop stop-color="#7f7f7f" offset="1" />
</linearGradient>
<linearGradient id="i-background">
<stop stop-color="#e0e0e0" offset="0" />
<stop stop-color="#ffffff" offset="1" />
</linearGradient>
<linearGradient id="red-background" x1="0" y1="0" x2="0" y2="1">
<stop stop-color="#ff9b9b" offset="0" />
<stop stop-color="#ffffff" offset="0.8" />
</linearGradient>
<linearGradient id="green-background" x1="0" y1="0" x2="0" y2="1">
<stop stop-color="#98ff98" offset="0" />
<stop stop-color="#ffffff" offset="0.8" />
</linearGradient>
<linearGradient id="blue-background" x1="0" y1="0" x2="0" y2="1">
<stop stop-color="#9999ff" offset="0" />
<stop stop-color="#ffffff" offset="0.8" />
</linearGradient>
</defs>
<rect x="1" y="1" width="46" height="46" ry="5"
style="fill: url(#base-background)" stroke="#bfbfbf" stroke-width="2" />
<circle cx="13.5" cy="12" r="4"
style="fill: url(#i-background)" stroke="#000000" stroke-width="2" />
<path d="m 9.75,24 0,13 a 3.5 3.5 180 0 0 7.5,0 l 0,-13 a 3.5 3.5 180 0 0 -7.5,0 z"
style="fill: url(#i-background)" stroke="#000000" stroke-width="2" />
<path d="m 22,8.25 6,0 3,3 3,-3 6,0 -9,10 z"
style="fill: url(#red-background)" stroke="#000000" stroke-width="2"
stroke-linejoin="round" />
<path d="m 22,19.5 6,0 3,3 3,-3 6,0 -9,10 z"
style="fill: url(#green-background)" stroke="#000000" stroke-width="2"
stroke-linejoin="round" />
<path d="m 22,30.75 6,0 3,3 3,-3 6,0 -9,10 z"
style="fill: url(#blue-background)" stroke="#000000" stroke-width="2"
stroke-linejoin="round" />
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -1,6 +1,6 @@
project('fastiv', 'c', default_options : ['c_std=gnu99'], version : '0.1.0')
# TODO(p): consider whether libraw_r would be appropriate
# TODO(p): Use libraw_r later, when we start parallelizing/preloading.
libraw = dependency('libraw', required : get_option('libraw'))
dependencies = [
dependency('gtk+-3.0'),
@ -17,7 +17,11 @@ configure_file(
configuration : conf,
)
# TODO(p): we need to create and install a .desktop file
executable('fastiv', 'fastiv.c', 'fastiv-view.c',
install : true,
dependencies : [dependencies])
install_data('fastiv.desktop',
install_dir : get_option('datadir') + '/applications')
install_data('fastiv.svg',
install_dir : get_option('datadir') + '/icons/hicolor/scalable/apps')