add option to prefix bundled icon names #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
hi hi hello!
I am hereby proposing this change and also providing an MVP implementation, hopeful to have this merged before 0.10.0 is released:
in order to follow best practices when bundling custom icons with a gtk app, it is advised to use an app specific prefix. for example, this is the way Tuba does it (a
tuba-prefix on each .svg file).the rationale is: as pointed out in #13/#29, the system icon theme gets priority over the bundled icons. if the identifiers are the same, this can lead to fun surprises when the icons in the system icon theme change, like this for example.
while it is currently possible to achieve the same thing by settings an
icons_folderwhen calling thebundle_iconsfunction in the build script, this is the only way to do it, so while all icons are always bundled, using a prefix requires you to manually bundle the svgs, which imo kinda defeats the point of the relm4-icons crate.this PR adds an extra parameter with an optional prefix to the
bundle_iconsfunction. if set toNone, the previous behavior is retained exactly as-is, so if someone wants to prefer the system icons, they still can. if set toSome(prefix), each icon's identifier (but not const name) gets prepended withprefix.I have also updated the README to reflect this change.
this change goes hand in hand with #29, both should be merged together.
let me know if there's anything else I missed here :) I would be open to changing the order of parameters so the prefix comes before the icon_names and icon_folder parameter, for example.