summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/control.cpp2
-rw-r--r--scene/resources/theme.cpp9
-rw-r--r--scene/resources/theme.h2
3 files changed, 11 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index a30c05527c..2912dcb3ae 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -2310,7 +2310,7 @@ void Control::_bind_methods() {
BIND_CONSTANT( ANCHOR_BEGIN );
BIND_CONSTANT( ANCHOR_END );
BIND_CONSTANT( ANCHOR_RATIO );
- BIND_CONSTANT( ANCHOR_CENTER );
+ BIND_CONSTANT( ANCHOR_CENTER );
BIND_CONSTANT( FOCUS_NONE );
BIND_CONSTANT( FOCUS_CLICK );
BIND_CONSTANT( FOCUS_ALL );
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index 74e59b09c3..20405a57b2 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -370,6 +370,13 @@ void Theme::get_stylebox_list(StringName p_type, List<StringName> *p_list) const
}
+void Theme::get_stylebox_types(List<StringName> *p_list) const {
+ const StringName *key=NULL;
+ while((key=style_map.next(key))) {
+ p_list->push_back(*key);
+ }
+}
+
void Theme::set_font(const StringName& p_name,const StringName& p_type,const Ref<Font>& p_font) {
ERR_FAIL_COND(p_font.is_null());
@@ -380,7 +387,6 @@ void Theme::set_font(const StringName& p_name,const StringName& p_type,const Ref
if (new_value) {
_change_notify();
emit_changed();;
-
}
}
Ref<Font> Theme::get_font(const StringName& p_name,const StringName& p_type) const {
@@ -604,6 +610,7 @@ void Theme::_bind_methods() {
ObjectTypeDB::bind_method(_MD("has_stylebox","name","type"),&Theme::has_stylebox);
ObjectTypeDB::bind_method(_MD("clear_stylebox","name","type"),&Theme::clear_stylebox);
ObjectTypeDB::bind_method(_MD("get_stylebox_list","type"),&Theme::_get_stylebox_list);
+ ObjectTypeDB::bind_method(_MD("get_stylebox_types"),&Theme::_get_stylebox_types);
ObjectTypeDB::bind_method(_MD("set_font","name","type","font:Font"),&Theme::set_font);
ObjectTypeDB::bind_method(_MD("get_font:Font","name","type"),&Theme::get_font);
diff --git a/scene/resources/theme.h b/scene/resources/theme.h
index 36630087f6..9b84d0e8ad 100644
--- a/scene/resources/theme.h
+++ b/scene/resources/theme.h
@@ -65,6 +65,7 @@ protected:
DVector<String> _get_icon_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_icon_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; }
DVector<String> _get_stylebox_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_stylebox_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; }
+ DVector<String> _get_stylebox_types(void) const { DVector<String> ilret; List<StringName> il; get_stylebox_types(&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; }
DVector<String> _get_font_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_font_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; }
DVector<String> _get_color_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_color_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; }
DVector<String> _get_constant_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_constant_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; }
@@ -100,6 +101,7 @@ public:
bool has_stylebox(const StringName& p_name,const StringName& p_type) const;
void clear_stylebox(const StringName& p_name,const StringName& p_type);
void get_stylebox_list(StringName p_type, List<StringName> *p_list) const;
+ void get_stylebox_types(List<StringName> *p_list) const;
void set_font(const StringName& p_name,const StringName& p_type,const Ref<Font>& p_font);
Ref<Font> get_font(const StringName& p_name,const StringName& p_type) const;