-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Add ThemeDB
, expose previously static Theme
methods
#64119
Conversation
98a5978
to
f835f4e
Compare
@@ -17,6 +17,7 @@ SConscript("animation/SCsub") | |||
SConscript("audio/SCsub") | |||
SConscript("resources/SCsub") | |||
SConscript("debugger/SCsub") | |||
SConscript("theme/SCsub") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect this under gui
more than its own folder, especially as it's only relevant for gui
(with the exception of the GUI-adjacent Window
and Label3D
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, and Theme
is a resource, so it could also be under resource
... 🙃 I have a plan for another class that could go into scene/theme
, and we already have audio
that similarly has shared classes in their own folder.
802f20b
to
7f8e9fe
Compare
This PR will keep failing CI because the new singleton needs to be added to the regression testing project. Currently it doesn't know about All other singleton exceptions are on this list (or are excepted based on the word "server" in their name, Obviously, there is no point updating the test project if this PR is not approved. So the plan is to get this reviewed and approved, then update the test project, then rerun the regression test here, and then it can be safely merged. |
8ed6d20
to
68a97f8
Compare
68a97f8
to
6320a0f
Compare
Thanks! |
This PR adds a
ThemeDB
engine singleton that can be used, so far, to access the default and the project theme, as well as fetch (and set!) fallback values for the entire theming system.This aims to provide ground work for any future implementation of godotengine/godot-proposals#4486. Regardless of what we agree upon in details, a theme database singleton makes a lot of sense to provide access to the theming system without overburdening the
Theme
resource itself with even more global data. I don't think I can finalize the idea of godotengine/godot-proposals#4486 before the Beta, let alone get it approved. So this should be a good first step to lay foundation for future changes. I expectThemeDB
to host and give access to well-defined theme properties of controls.But thus far it only exposes static information related to themes and takes a bit of code off of
theme.cpp
's hands.