Skip to content

Commit 2b08907

Browse files
author
Vasily Galkin
committed
icons: embed application icon as a resource too
Before this patch not-installed meld or meld built for windows has problems loading its own svg icon, since the icon doesn't present in resources and were never installed into the OS. This leads to lack of application icon on non-Gnome linux DE's and lack of icon inside about window on all platforms. This patch embeds application icon into resources, so it is usable from inside meld even if it is not installed. This change can lead to a situation when builtin icon overrides the icon from a user-configured icon theme.
1 parent 353f8ae commit 2b08907

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

bin/meld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ def setup_resources():
273273
"glib-compile-resources",
274274
"--target={}".format(resource_file),
275275
"--sourcedir=meld/resources",
276+
"--sourcedir=data/icons/hicolor",
276277
"meld/resources/meld.gresource.xml",
277278
],
278279
cwd=melddir

meld/build_helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def get_data_files(self):
117117
"glib-compile-resources",
118118
"--target={}".format(target),
119119
"--sourcedir={}".format(resource_dir),
120+
"--sourcedir={}".format("data/icons/hicolor"),
120121
self.resource_source,
121122
])
122123

meld/resources/meld.gresource.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<gresources>
3+
<gresource prefix="/org/gnome/meld/icons">
4+
<file>scalable/apps/org.gnome.Meld.svg</file>
5+
<file>scalable/apps/org.gnome.MeldDevel.svg</file>
6+
</gresource>
37
<gresource prefix="/org/gnome/meld">
48
<file>gtk/help-overlay.ui</file>
59
<file>gtk/menus.ui</file>

meld/resources/meson.build

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ gnome.compile_resources(
22
application_id,
33
meson.project_name() + '.gresource.xml',
44
gresource_bundle: true,
5-
source_dir: meson.current_build_dir(),
5+
source_dir: [
6+
meson.current_build_dir(),
7+
meson.current_source_dir() + '/../../data/icons/hicolor'
8+
],
69
install_dir: pkgdatadir,
710
install: true,
811
)

0 commit comments

Comments
 (0)