Increased Flexibility in Theme Configuration System #4457
YourRobotOverlord
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I would love to see increased flexibility in the theme configuration system in TG.
To this end, I think SchemeManager should not throw an exception when a named scheme is not found in the config file.
Some examples of where it would be useful:
SchemeNameof a view (as I always do for allTextInputviews), the theme must also contain a definition for it.Right now, any existing themes, or the TG hardcoded defaults, are incompatible and will cause an exception.
My proposal is to implement a more robust fallback system. For example,
View.GetSchemedoes have a partial fallback path, but only ifSchemeNamehas not been set:SuperView scheme -> Base schemeWhat I propose uses the following fallback path in all cases:
Requested scheme -> Superview scheme -> Base scheme -> Hard-coded Base schemeThis would have the added benefit of allowing scheme definitions to be simpler, for example you could just set:
This would be enough to define the theme for the entire app.
I have played around with this a bit and managed to get something working:
In
SchemeManager, I addedTryGetScheme:In
View.Drawing.Scheme, I replacedGetScheme:and added a fallback resolver:
Yes, its unrefined, incomplete, probably faulty, and probably breaks other things, but it proves the concept.
Custom theme with

TextInputscheme defined:Switching to a theme without

TextInputdefined and everything still works:I think that even if most end users never open a config file to edit a application theme, enough do to consider it an "end-user feature".
I also think a goal for any feature intended for end-users should be that it never throws exceptions, because the end-user screwing it up is not exceptional.
All reactions