diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-09-06 16:11:05 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-09-06 19:40:43 +0200 |
commit | 58126e479cd7341ec2ae306131e14868bcff06ca (patch) | |
tree | c0e965296b435f908a18401717b337fcbafc3e2f /tests | |
parent | 8449592d92eaeef990f5502b419d491ee3eeb7a6 (diff) | |
download | redot-engine-58126e479cd7341ec2ae306131e14868bcff06ca.tar.gz |
Introduce the concept of global theme contexts
This commit adds the default theme context, which replaces
the need to manually check the project and the default theme
all the time; simplifies related code.
It also adds framework for custom theme contexts, to be used
by the editor. Custom contexts can be attached to any node,
and not necessarily a GUI/Window node. Contexts do no break
theme inheritance and only define which global themes a node
uses as a fallback.
Contexts propagate NOTIFICATION_THEME_CHANGED when one of their
global themes changes. This ensures that global themes act just
like themes assigned to individual nodes and can be previewed
live in the editor.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_main.cpp b/tests/test_main.cpp index a4306db6f4..3a80fc8c00 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -238,7 +238,9 @@ struct GodotTestCaseListener : public doctest::IReporter { RenderingServerDefault::get_singleton()->set_render_loop_enabled(false); // ThemeDB requires RenderingServer to initialize the default theme. - // So we have to do this for each test case. + // So we have to do this for each test case. Also make sure there is + // no residual theme from something else. + ThemeDB::get_singleton()->finalize_theme(); ThemeDB::get_singleton()->initialize_theme_noproject(); physics_server_3d = PhysicsServer3DManager::get_singleton()->new_default_server(); |