Summary: | Some Breeze (light) icons not recolored for the Breeze Dark package | ||
---|---|---|---|
Product: | [Plasma] Breeze | Reporter: | Corbin <schwimmbeckc> |
Component: | Icons | Assignee: | visual-design |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kainz.a, m |
Priority: | NOR | ||
Version First Reported In: | 6.0.4 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | All | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
breeze 6 left vs breeze 5 right (from the fedora rpms, identical to arch packages)
breeze 6 left vs breeze 5 right (dark) (from the fedora rpms, identical to arch packages) |
Description
Corbin
2024-05-19 14:05:12 UTC
*** Bug 487234 has been marked as a duplicate of this bug. *** Created attachment 169616 [details]
breeze 6 left vs breeze 5 right (from the fedora rpms, identical to arch packages)
Not sure why this didn't attach to the main comment.
Comment on attachment 169616 [details]
breeze 6 left vs breeze 5 right (from the fedora rpms, identical to arch packages)
Wait, wrong picture.
Created attachment 169617 [details]
breeze 6 left vs breeze 5 right (dark) (from the fedora rpms, identical to arch packages)
All right, sorry for the abject incompetence on display on my part, I hope I got this report properly assembled now.
Looking into this more, I found the regular expression that find the style color: "\\.ColorScheme-(\\S+){color:(#[0-9a-fA-F]+);}" (https://invent.kde.org/frameworks/breeze-icons/-/blob/master/src/tools/generate-symbolic-dark.cpp?ref_type=heads) Which works, until some of the svg files are formatted like this: (actions/16/blur.svg) <style>.ColorScheme-Text { color:#232629; }</style> There you'd need "\\.ColorScheme-(\\S+)\\s*{\\s*color:(#[0-9a-fA-F]+);\\s*}" But it also fails for files like actions/16/bookmark-remove: <style type="text/css" id="current-color-scheme">.ColorScheme-Text{color:#232629;}.ColorScheme-NegativeText { color: #da4453; } </style> Matter of fact, the pattern also doesn't match the latter negative text color scheme, due to the additional space between color: and the #, needing even more \s* patterns to properly detect all of these edge cases. Though for this one, it doesn't matter, as only Text and Background are actually handled in the code anyway. Though it'd probably be simpler to eliminate all whitespace before trying to use regex to parse this. Interestingly, it did work for a different file, where that looked like this: <style type="text/css" id="current-color-scheme">.ColorScheme-Text { color: #fcfcfc; } </style> with spaces in various positions. And another one where it failed was well formatted, with no whitespace: <style type="text/css" id="current-color-scheme">.ColorScheme-Text{color:#232629;}.ColorScheme-NeutralText{color:#f67400;}.ColorScheme-NegativeText { color: #da4453; } </style> The only consistent throughline here is that all the ones that failed, had more than one ColorScheme set. Which shouldn't be the issue, since a regex iterator is used, but that's just what must be happening. I shall attempt to fix the issue, but success isn't guaranteed... I've found the issue. It's the greedy match on \S+ which WILL match across the other tags, creating one giant abomination of a match when there are multiple tags present. Classic regex. Merge Request incoming, hopefully I remember how to do that correctly. A possibly relevant merge request was started @ https://invent.kde.org/frameworks/breeze-icons/-/merge_requests/372 Ah, turns out I used the wrong email for opening this bug report, so it didn't auto close. Anyway, my merge request was accepted, this problem will be solved with the next release. |