Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement (hacky) support for scalable icons #494

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tharre
Copy link

@Tharre Tharre commented Jan 20, 2024

Previously, any icons that were found in folders like scalable or symbolic were ignored because they didn't contain any sizing information. Instead, assume any icons ending with ".svg" to be scalable as it's the only supported vectorized format.

With this, the adwaita icon theme should work again, they removed most of their fixed size icons semirecently:

https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/issues/221

Previously, any icons that were found in folders like scalable or
symbolic were ignored because they didn't contain any sizing
information. Instead, assume any icons ending with ".svg" to be
scalable as it's the only supported vectorized format.

With this, the adwaita icon theme should work again, they removed most
of their fixed size icons semirecently:

https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/issues/221
@@ -170,6 +170,13 @@ static char *resolve_icon(struct mako_notification *notif) {
for (size_t i = 0; i < found_count; ++i) {
char *relative_path = icon_glob.gl_pathv[i];

if (!strcmp(relative_path+strlen(relative_path)-4, ".svg")) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a better approach would be to check if the size subdir is named "scalable"?

Copy link
Author

@Tharre Tharre Jan 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would have to check for "scalable" and "symbolic", but yeah, possibly. There definitely seem to be themes that have more complex SVGs for bigger sizes, so not throwing away sizing information for them may be desirable.

On the other hand I don't know if other icon themes use different names for this; though spot checking the arch repos that does seem to be a common theme.

For my usecase this definitely works, if you want I can update this PR to this commit:
Tharre@d685b90

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, right, I suppose that to do things the Right Way, we'd need to parse the theme .ini files... Although, maybe we should keep parsing the size if there are .svg files in a directory with a fixed size...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants