summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authortoger5 <toger5@hotmail.de>2017-09-14 18:15:04 +0200
committertoger5 <toger5@hotmail.de>2017-09-14 18:15:39 +0200
commit202e4c8836ab99e818ce43431a87621bb39181e4 (patch)
tree2d016de5e8f2a83a9d5a638843908ffc4a059d4b /scene
parent175777596ec3521731665dd750fd7087793b10fc (diff)
also loop for classes if there is no coustom theme fixes #11250
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/control.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 87dfd95724..2d5b54257a 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -809,9 +809,9 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName &
// try with custom themes
Control *theme_owner = data.theme_owner;
- while (theme_owner) {
+ StringName class_name = type;
- StringName class_name = type;
+ while (theme_owner) {
while (class_name != StringName()) {
if (theme_owner->data.theme->has_stylebox(p_name, class_name)) {
@@ -829,6 +829,14 @@ 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);
+
+ class_name = ClassDB::get_parent_class_nocheck(class_name);
+ }
return Theme::get_default()->get_stylebox(p_name, type);
}
Ref<Font> Control::get_font(const StringName &p_name, const StringName &p_type) const {