summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2022-06-01 04:20:00 +0300
committerYuri Sizov <yuris@humnom.net>2022-06-01 04:20:00 +0300
commitba273c6c5f1f3ae5601afcb7071d73a2f9d1628f (patch)
treece5702da373773b983c298d0bd512de101417223 /scene/main
parent70eaaf2a011f6f36779022ac18a1513acece012c (diff)
Fix theme propagation for children of top level controls and windows
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/window.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index 193f18c075..b680c7c6df 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -791,6 +791,22 @@ void Window::_notification(int p_what) {
emit_signal(SceneStringNames::get_singleton()->visibility_changed);
RS::get_singleton()->viewport_set_active(get_viewport_rid(), true);
}
+
+ if (theme.is_null()) {
+ Control *parent_c = cast_to<Control>(get_parent());
+ if (parent_c && (parent_c->data.theme_owner || parent_c->data.theme_owner_window)) {
+ theme_owner = parent_c->data.theme_owner;
+ theme_owner_window = parent_c->data.theme_owner_window;
+ notification(NOTIFICATION_THEME_CHANGED);
+ } else {
+ Window *parent_w = cast_to<Window>(get_parent());
+ if (parent_w && (parent_w->theme_owner || parent_w->theme_owner_window)) {
+ theme_owner = parent_w->theme_owner;
+ theme_owner_window = parent_w->theme_owner_window;
+ notification(NOTIFICATION_THEME_CHANGED);
+ }
+ }
+ }
} break;
case NOTIFICATION_READY: {