From 193f6b753ebb44e7a7b19a034e632f4236bbba66 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sat, 15 Dec 2018 21:51:57 +0100 Subject: theming: Add option to disable HiDPI for any particular image size Useful for 4k size where additional HiDPI sizes (i.e. 6k and 8k) are overkill to generate and aren't very common on the market yet. --- src/setup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/setup.c b/src/setup.c index 85c7326..9dedd77 100644 --- a/src/setup.c +++ b/src/setup.c @@ -200,6 +200,7 @@ parse_design_setup_xml (const gchar *filename) TGalleryDesignTheme *theme; int count, c; int i, j; + gboolean no_hidpi; xml = xml_parser_load (filename); if (xml == NULL) @@ -309,8 +310,12 @@ parse_design_setup_xml (const gchar *filename) image_size->quality_threshold = xml_file_get_node_attribute_long_with_default (xml, s, "quality", DEFAULT_QUALITY_THRESHOLD); g_free (s); + s = g_strdup_printf ("/design_setup/image_sizes/size[%d]/no_hidpi", i + 1); + no_hidpi = xml_file_get_node_present (xml, s); + g_free (s); + /* Generate HiDPI sizes */ - if (design->hidpi_sizes) + if (design->hidpi_sizes && !no_hidpi) for (j = 0; design->hidpi_sizes[j] != 0; j++ ) { hidpi_image_size = g_malloc0 (sizeof (TImageSize)); memcpy (hidpi_image_size, image_size, sizeof (TImageSize)); -- cgit v1.2.3