diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-01-05 04:22:06 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-01-05 18:30:40 +0100 |
commit | a63a82d5e5e062566b62f1984e4669b01f880c9d (patch) | |
tree | 999e2fd095a9f29e6bc2e345ed0ff95cb5d632b3 | |
parent | 003f2dab786c76ff0e9041b173ea6c7b3b572403 (diff) |
Fix theme inheritance
-rw-r--r-- | scene/gui/control.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 6419659741..979a65f455 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -861,6 +861,8 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName & class_name = ClassDB::get_parent_class_nocheck(class_name); } + class_name = type; + Control *parent = Object::cast_to<Control>(theme_owner->get_parent()); if (parent) @@ -869,8 +871,6 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName & theme_owner = NULL; } - class_name = type; - while (class_name != StringName()) { if (Theme::get_default()->has_stylebox(p_name, class_name)) return Theme::get_default()->get_stylebox(p_name, class_name); @@ -2155,6 +2155,7 @@ void Control::set_theme(const Ref<Theme> &p_theme) { data.theme = p_theme; if (!p_theme.is_null()) { + data.theme_owner = this; _propagate_theme_changed(this, this); } else { |