Include hicolor index.theme as a resource

index.theme file copied from upstream xdg/default-icon-theme
repository at tag 0.17:

https://gitlab.freedesktop.org/xdg/default-icon-theme/-/tree/0.17

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5303
This commit is contained in:
Luca Bacci 2022-12-16 14:17:29 +01:00
parent aafc6279a3
commit b563736b66
3 changed files with 3821 additions and 44 deletions

View File

@ -70,6 +70,10 @@ for f in get_files('ui', '.ui'):
xml += '\n'
xml += '''
<file compressed="true">icons/hicolor.index.theme</file>
'''
for s in ['16x16', '32x32', '64x64', 'scalable']:
for c in ['actions', 'categories', 'emblems', 'emotes', 'devices', 'mimetypes', 'places', 'status']:
icons_dir = 'icons/{0}/{1}'.format(s,c)

View File

@ -1703,49 +1703,6 @@ gtk_icon_theme_get_theme_name (GtkIconTheme *self)
return theme_name;
}
static const char builtin_hicolor_index[] =
"[Icon Theme]\n"
"Name=Hicolor\n"
"Hidden=True\n"
"Directories=16x16/actions,16x16/status,22x22/actions,24x24/actions,24x24/status,32x32/actions,32x32/status,48x48/status,64x64/actions,scalable/status,scalable/actions\n"
"[16x16/actions]\n"
"Size=16\n"
"Type=Threshold\n"
"[16x16/status]\n"
"Size=16\n"
"Type=Threshold\n"
"[22x22/actions]\n"
"Size=22\n"
"Type=Threshold\n"
"[24x24/actions]\n"
"Size=24\n"
"Type=Threshold\n"
"[24x24/status]\n"
"Size=24\n"
"Type=Threshold\n"
"[32x32/actions]\n"
"Size=32\n"
"Type=Threshold\n"
"[32x32/status]\n"
"Size=32\n"
"Type=Threshold\n"
"[48x48/status]\n"
"Size=48\n"
"Type=Threshold\n"
"[64x64/actions]\n"
"Size=64\n"
"Type=Threshold\n"
"[scalable/status]\n"
"MinSize=1\n"
"Size=128\n"
"MaxSize=256\n"
"Type=Scalable\n"
"[scalable/actions]\n"
"MinSize=1\n"
"Size=128\n"
"MaxSize=256\n"
"Type=Scalable\n";
static void
insert_theme (GtkIconTheme *self,
const char *theme_name)
@ -1812,9 +1769,20 @@ insert_theme (GtkIconTheme *self,
{
if (strcmp (theme_name, FALLBACK_ICON_THEME) == 0)
{
const char *resource_path = "/org/gtk/libgtk/icons/hicolor.index.theme";
GBytes *index;
index = g_resources_lookup_data (resource_path,
G_RESOURCE_LOOKUP_FLAGS_NONE,
NULL);
if (!index)
g_error ("Cannot find resource %s", resource_path);
theme_file = g_key_file_new ();
g_key_file_set_list_separator (theme_file, ',');
g_key_file_load_from_data (theme_file, builtin_hicolor_index, -1, 0, NULL);
g_key_file_load_from_bytes (theme_file, index, G_KEY_FILE_NONE, NULL);
g_bytes_unref (index);
}
else
return;

File diff suppressed because one or more lines are too long