summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2018-12-15 21:51:57 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2018-12-15 21:51:57 +0100
commit193f6b753ebb44e7a7b19a034e632f4236bbba66 (patch)
treecbed44d2f5b661375704fc244924dcd4689c0e09
parentea811026c7f88925703a26778f7b739549896abf (diff)
downloadcataract-193f6b753ebb44e7a7b19a034e632f4236bbba66.tar.xz
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.
-rw-r--r--src/setup.c7
-rw-r--r--templates/fluid/fluid.xml2
2 files changed, 8 insertions, 1 deletions
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));
diff --git a/templates/fluid/fluid.xml b/templates/fluid/fluid.xml
index b62c1d3..8d2bdbc 100644
--- a/templates/fluid/fluid.xml
+++ b/templates/fluid/fluid.xml
@@ -36,6 +36,8 @@
<quality value="93" />
<fallback size="hires" />
<threshold no_resize="20" availability="20" quality="5" />
+ <!-- don't generate HiDPI images for this size -->
+ <no_hidpi />
</size>
</image_sizes>