elementary / tasks

Synced tasks and reminders on elementary OS

Home Page:https://elementary.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hicolor icon theme does not support @2 scaled icons

decathorpe opened this issue · comments

What Happened?

I am working on packaging elementary tasks for Fedora. The package reviewer pointed out to me that duplicated icons are installed into 32x32 and 32x32@2, etc. I wonder why that is the case, since both versions appear to be identical svg files.

Additionally, it looks like the hicolor icon theme does not support @2 scaled icons at all.
Querying the entire Fedora package set, no single package provides @2 icons for the hicolor theme.

Steps to Reproduce

Run "meson build", "ninja", "ninja install", and see duplicated icons getting installed.

Expected Behavior

No needlessly duplicated icon files should be installed, and the @2 scaled versions don't seem to be supported by hicolor icon theme anyway.

OS Version

Other Linux

Software Version

Latest release (I have run all updates)

Log Output

output from ninja install:

(...)
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/16.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/16x16/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/16.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/16x16@2/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/24.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/24x24/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/24.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/24x24@2/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/32.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/32x32/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/32.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/32x32@2/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/48.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/48x48/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/48.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/48x48@2/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/64.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/64x64/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/64.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/64x64@2/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/128.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/128x128/apps
Installing /builddir/build/BUILD/elementary-tasks-6.1.0+git211227.162534.d161db77/data/icons/128.svg to /builddir/build/BUILDROOT/elementary-tasks-6.1.0+git211227.162534.d161db77-1.fc36.x86_64/usr/share/icons/hicolor/128x128@2/apps
(...)

It appears that indeed, meson is set up to install NxN icons to both NxN/apps/* and NxN@2/apps/*, which seems weird to me.

Hardware Info

Build log snippet from Fedora 34 / 35 / Rawhide.

So I actually implemented this support in hicolor: https://gitlab.freedesktop.org/xdg/default-icon-theme/-/commit/6afc6a5a4cfb429de667e1e562491e7662e00d73

The icons need to be in both directories just because of the way icon themes are set up. They're SVG but GTK will load a larger icon rather than scale unless they're specified like this as HiDPI icons

So I actually implemented this support in hicolor: https://gitlab.freedesktop.org/xdg/default-icon-theme/-/commit/6afc6a5a4cfb429de667e1e562491e7662e00d73

So the directories are indeed added to the index.theme file, but they are not created while building, which is strange.

The icons need to be in both directories just because of the way icon themes are set up. They're SVG but GTK will load a larger icon rather than scale unless they're specified like this as HiDPI icons

Ah this piece of information was missing, thanks! Would symlinking also work? This way we don't need to store duplicated icons.

Sure symlinking should also work :)

Looks like this issue is known since 2018, with a proposed patch to fix it, but the project hasn't been touched since the 0.17 release in 2017 ...

https://gitlab.freedesktop.org/xdg/default-icon-theme/-/issues/2