-
Notifications
You must be signed in to change notification settings - Fork 3
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
Themes should allow importing other themes as a base. #236
Comments
To check if a theme doesn't have a required key, there should be a script that takes the default theme (the dark one) and converts it into minified JSON that we load in to compare the requested theme at runtime. The script would need to be run after adding new supported keys. This JSON only has keys, no values, and values are either filled from the imported theme or the default theme (which should also be loaded at runtime along with the imported theme if it exists but both should be thrown out after we're done loading everything into the dict, because all that remains will be the "compiled" theme consisting of the requested theme and any gaps that were filled in). Maybe there should be support for versioning the theme engine, I'm not sure because that may be a lot more difficult to put into every program. (The following paragraph was copied into #238 because it needs to be its own issue but I'm leaving it here because it leaves off from the previous paragraph) |
Ok that last comment isn't getting the link to #238 correctly even after editing it. |
I know an easy way to check if a theme has what's needed: load themes in using configparser and check if it |
It could get really bad for theme maintenance at some point if it doesn't. I'd need to have a file that says what keys are expected for themes to contain for each version of Retiled, and that would be used for when we load themes where we'll see if a theme has a required key, and if it doesn't, use the theme it imports instead. If that theme doesn't have it, ideally we should keep going until we run out of themes to import from, then use the default value, but I don't know how to reasonably do the recursive import thing so for now I'm going to just do a one-layer import as that's simpler.
So in summary when loading into the dict, we'll check if each key is in the theme, and if not, substitute it with the one it imports or the default value if its import doesn't have it.
I think KDE Plasma has this feature, but I don't remember.
The text was updated successfully, but these errors were encountered: