From 1a6086f6e16db1536e04050a0ac2637cc0f7d8b8 Mon Sep 17 00:00:00 2001 From: Burt P Date: Sat, 6 Jul 2019 23:20:30 -0500 Subject: Add SVG icon support in report HTML and Xubuntu icon to demonstrate Signed-off-by: Burt P --- modules/computer/ubuntu_flavors.c | 2 +- pixmaps/distros/xubuntu.svg | 1 + shell/report.c | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 pixmaps/distros/xubuntu.svg diff --git a/modules/computer/ubuntu_flavors.c b/modules/computer/ubuntu_flavors.c index d6933604..9bc32d74 100644 --- a/modules/computer/ubuntu_flavors.c +++ b/modules/computer/ubuntu_flavors.c @@ -26,7 +26,7 @@ static const UbuntuFlavor ubuntu_flavors[] = { { "ubuntu-server", "Vanilla Server", "distros/ubuntu.png", "https://ubuntu.org/" }, { "ubuntu-desktop", "Ubuntu GNOME", "distros/ubuntu.png", "https://ubuntu.org/" }, - { "xubuntu-desktop", "Xubuntu", "distros/xubuntu.png", "https://xubuntu.org/" }, + { "xubuntu-desktop", "Xubuntu", "distros/xubuntu.svg", "https://xubuntu.org/" }, { "kubuntu-desktop", "Kubuntu", "distros/kubuntu.png", "https://kubuntu.org/" }, { "lubuntu-desktop", "Lubuntu", "distros/lubuntu.png", "https://lubuntu.me/" }, /* formerly or also lubuntu.net? */ { "ubuntu-mate-desktop", "Ubuntu MATE", "distros/ubuntu-mate.png", "https://ubuntu-mate.org/" }, diff --git a/pixmaps/distros/xubuntu.svg b/pixmaps/distros/xubuntu.svg new file mode 100644 index 00000000..cce15022 --- /dev/null +++ b/pixmaps/distros/xubuntu.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/shell/report.c b/shell/report.c index 429d0746..89fcc4a3 100644 --- a/shell/report.c +++ b/shell/report.c @@ -107,7 +107,9 @@ gchar *make_icon_css(const gchar *file) { gsize length = 0; if ( g_file_get_contents(path, &contents, &length, NULL) ) { gchar *css_class = icon_name_css_id(file); - const char ctype[] = "image/png"; + const char *ctype = "image/png"; + if (g_str_has_suffix(file, ".svg") ) + ctype = "image/svg+xml"; gchar *b64data = g_base64_encode(contents, length); ret = g_strdup_printf( ".%s\n" -- cgit v1.2.3