Parse all branding colors from appstream (elementary#2140) #2226
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.
Short summary
Aims to fix #2140
This will parse all the branding possibilities of the metadata info according to the freedesktop docs here.
The branding tag has a must-have color tag with
primary_color
attribute (always set its value toprimary
), with an optionalscheme_preference
attribute which shows a preference for a particular color scheme (withe light or dark) and this should take precedence.But, as the issue says, there can be multiple setups here, and this PR aims to account for all of these in the following order:
scheme_preference
, either set to light or dark, it should be taken as precedent, according to the desktop current color scheme (viagtk_application_prefer_dark_theme
).scheme_preference
(i.e. unknown). This was the original call.Tests
Apps that I tested with this change:
scheme_preference
attribute). Different colors per tag.I couldn't find an application that had only the no
scheme_preference
attribute, but it was the default original call, so it should cover that case as well.