diff options
53 files changed, 804 insertions, 704 deletions
diff --git a/core/doc_data.h b/core/doc_data.h index 066cc6b848..27ea098513 100644 --- a/core/doc_data.h +++ b/core/doc_data.h @@ -135,7 +135,11 @@ public: String description; String default_value; bool operator<(const ThemeItemDoc &p_theme_item) const { - return name < p_theme_item.name; + // First sort by the data type, then by name. + if (data_type == p_theme_item.data_type) { + return name < p_theme_item.name; + } + return data_type < p_theme_item.data_type; } }; diff --git a/core/extension/gdnative_interface.cpp b/core/extension/gdnative_interface.cpp index 19988a26cb..0c9b344a37 100644 --- a/core/extension/gdnative_interface.cpp +++ b/core/extension/gdnative_interface.cpp @@ -827,16 +827,21 @@ static GDNativeObjectPtr gdnative_global_get_singleton(const char *p_name) { return (GDNativeObjectPtr)Engine::get_singleton()->get_singleton_object(String(p_name)); } -static void *gdnative_object_get_instance_binding(GDNativeObjectPtr p_instance, void *p_token, const GDNativeInstanceBindingCallbacks *p_callbacks) { - Object *o = (Object *)p_instance; +static void *gdnative_object_get_instance_binding(GDNativeObjectPtr p_object, void *p_token, const GDNativeInstanceBindingCallbacks *p_callbacks) { + Object *o = (Object *)p_object; return o->get_instance_binding(p_token, p_callbacks); } -static void gdnative_object_set_instance_binding(GDNativeObjectPtr p_instance, void *p_token, void *p_binding, const GDNativeInstanceBindingCallbacks *p_callbacks) { - Object *o = (Object *)p_instance; +static void gdnative_object_set_instance_binding(GDNativeObjectPtr p_object, void *p_token, void *p_binding, const GDNativeInstanceBindingCallbacks *p_callbacks) { + Object *o = (Object *)p_object; o->set_instance_binding(p_token, p_binding, p_callbacks); } +static void gdnative_object_set_instance(GDNativeObjectPtr p_object, const char *p_classname, GDExtensionClassInstancePtr p_instance) { + Object *o = (Object *)p_object; + ClassDB::set_object_extension_instance(o, p_classname, p_instance); +} + static GDNativeObjectPtr gdnative_object_get_instance_from_id(GDObjectInstanceID p_instance_id) { return (GDNativeObjectPtr)ObjectDB::get_instance(ObjectID(p_instance_id)); } @@ -866,19 +871,8 @@ static GDNativeMethodBindPtr gdnative_classdb_get_method_bind(const char *p_clas return (GDNativeMethodBindPtr)mb; } -static GDNativeClassConstructor gdnative_classdb_get_constructor(const char *p_classname, GDNativeExtensionPtr *r_extension) { - ClassDB::ClassInfo *class_info = ClassDB::classes.getptr(StringName(p_classname)); - if (class_info) { - if (r_extension) { - *r_extension = class_info->native_extension; - } - return (GDNativeClassConstructor)class_info->creation_func; - } - return nullptr; -} - -static GDNativeObjectPtr gdnative_classdb_construct_object(GDNativeClassConstructor p_constructor, GDNativeExtensionPtr p_extension) { - return (GDNativeObjectPtr)ClassDB::construct_object((Object * (*)()) p_constructor, (ObjectNativeExtension *)p_extension); +static GDNativeObjectPtr gdnative_classdb_construct_object(const char *p_classname) { + return (GDNativeObjectPtr)ClassDB::instantiate(p_classname); } static void *gdnative_classdb_get_class_tag(const char *p_classname) { @@ -1026,6 +1020,7 @@ void gdnative_setup_interface(GDNativeInterface *p_interface) { gdni.global_get_singleton = gdnative_global_get_singleton; gdni.object_get_instance_binding = gdnative_object_get_instance_binding; gdni.object_set_instance_binding = gdnative_object_set_instance_binding; + gdni.object_set_instance = gdnative_object_set_instance; gdni.object_cast_to = gdnative_object_cast_to; gdni.object_get_instance_from_id = gdnative_object_get_instance_from_id; @@ -1033,7 +1028,6 @@ void gdnative_setup_interface(GDNativeInterface *p_interface) { /* CLASSDB */ - gdni.classdb_get_constructor = gdnative_classdb_get_constructor; gdni.classdb_construct_object = gdnative_classdb_construct_object; gdni.classdb_get_method_bind = gdnative_classdb_get_method_bind; gdni.classdb_get_class_tag = gdnative_classdb_get_class_tag; diff --git a/core/extension/gdnative_interface.h b/core/extension/gdnative_interface.h index e411a9d85b..2191d99dea 100644 --- a/core/extension/gdnative_interface.h +++ b/core/extension/gdnative_interface.h @@ -211,7 +211,7 @@ typedef const char *(*GDNativeExtensionClassToString)(GDExtensionClassInstancePt typedef void (*GDNativeExtensionClassReference)(GDExtensionClassInstancePtr p_instance); typedef void (*GDNativeExtensionClassUnreference)(GDExtensionClassInstancePtr p_instance); typedef void (*GDNativeExtensionClassCallVirtual)(GDExtensionClassInstancePtr p_instance, const GDNativeTypePtr *p_args, GDNativeTypePtr r_ret); -typedef GDExtensionClassInstancePtr (*GDNativeExtensionClassCreateInstance)(void *p_userdata); +typedef GDNativeObjectPtr (*GDNativeExtensionClassCreateInstance)(void *p_userdata); typedef void (*GDNativeExtensionClassFreeInstance)(void *p_userdata, GDExtensionClassInstancePtr p_instance); typedef void (*GDNativeExtensionClassObjectInstance)(GDExtensionClassInstancePtr p_instance, GDNativeObjectPtr p_object_instance); typedef GDNativeExtensionClassCallVirtual (*GDNativeExtensionClassGetVirtual)(void *p_userdata, const char *p_name); @@ -227,7 +227,6 @@ typedef struct { GDNativeExtensionClassUnreference unreference_func; GDNativeExtensionClassCreateInstance create_instance_func; /* this one is mandatory */ GDNativeExtensionClassFreeInstance free_instance_func; /* this one is mandatory */ - GDNativeExtensionClassObjectInstance object_instance_func; /* this one is mandatory */ GDNativeExtensionClassGetVirtual get_virtual_func; void *class_userdata; } GDNativeExtensionClassCreationInfo; @@ -428,17 +427,18 @@ typedef struct { void (*object_method_bind_ptrcall)(const GDNativeMethodBindPtr p_method_bind, GDNativeObjectPtr p_instance, const GDNativeTypePtr *p_args, GDNativeTypePtr r_ret); void (*object_destroy)(GDNativeObjectPtr p_o); GDNativeObjectPtr (*global_get_singleton)(const char *p_name); + void *(*object_get_instance_binding)(GDNativeObjectPtr p_o, void *p_token, const GDNativeInstanceBindingCallbacks *p_callbacks); void (*object_set_instance_binding)(GDNativeObjectPtr p_o, void *p_token, void *p_binding, const GDNativeInstanceBindingCallbacks *p_callbacks); + void (*object_set_instance)(GDNativeObjectPtr p_o, const char *p_classname, GDExtensionClassInstancePtr p_instance); /* p_classname should be a registered extension class and should extend the p_o object's class. */ + GDNativeObjectPtr (*object_cast_to)(const GDNativeObjectPtr p_object, void *p_class_tag); GDNativeObjectPtr (*object_get_instance_from_id)(GDObjectInstanceID p_instance_id); GDObjectInstanceID (*object_get_instance_id)(const GDNativeObjectPtr p_object); /* CLASSDB */ - - GDNativeClassConstructor (*classdb_get_constructor)(const char *p_classname, GDNativeExtensionPtr *r_extension); - GDNativeObjectPtr (*classdb_construct_object)(GDNativeClassConstructor p_constructor, GDNativeExtensionPtr p_extension); + GDNativeObjectPtr (*classdb_construct_object)(const char *p_classname); /* The passed class must be a built-in godot class, or an already-registered extension class. In both case, object_set_instance should be called to fully initialize the object. */ GDNativeMethodBindPtr (*classdb_get_method_bind)(const char *p_classname, const char *p_methodname, GDNativeInt p_hash); void *(*classdb_get_class_tag)(const char *p_classname); diff --git a/core/extension/native_extension.cpp b/core/extension/native_extension.cpp index a6b0a708c3..ae7620fec4 100644 --- a/core/extension/native_extension.cpp +++ b/core/extension/native_extension.cpp @@ -156,7 +156,6 @@ void NativeExtension::_register_extension_class(const GDNativeExtensionClassLibr extension->native_extension.unreference = p_extension_funcs->unreference_func; extension->native_extension.class_userdata = p_extension_funcs->class_userdata; extension->native_extension.create_instance = p_extension_funcs->create_instance_func; - extension->native_extension.set_object_instance = p_extension_funcs->object_instance_func; extension->native_extension.free_instance = p_extension_funcs->free_instance_func; extension->native_extension.get_virtual = p_extension_funcs->get_virtual_func; diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 4b3c8b123f..ac628acf81 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -497,22 +497,6 @@ void ClassDB::add_compatibility_class(const StringName &p_class, const StringNam compat_classes[p_class] = p_fallback; } -thread_local bool initializing_with_extension = false; -thread_local ObjectNativeExtension *initializing_extension = nullptr; -thread_local GDExtensionClassInstancePtr initializing_extension_instance = nullptr; - -void ClassDB::instance_get_native_extension_data(ObjectNativeExtension **r_extension, GDExtensionClassInstancePtr *r_extension_instance, Object *p_base) { - if (initializing_with_extension) { - *r_extension = initializing_extension; - *r_extension_instance = initializing_extension_instance; - initializing_with_extension = false; - initializing_extension->set_object_instance(*r_extension_instance, p_base); - } else { - *r_extension = nullptr; - *r_extension_instance = nullptr; - } -} - Object *ClassDB::instantiate(const StringName &p_class) { ClassInfo *ti; { @@ -533,21 +517,31 @@ Object *ClassDB::instantiate(const StringName &p_class) { return nullptr; } #endif - if (ti->native_extension) { - initializing_with_extension = true; - initializing_extension = ti->native_extension; - initializing_extension_instance = ti->native_extension->create_instance(ti->native_extension->class_userdata); + if (ti->native_extension && ti->native_extension->create_instance) { + return (Object *)ti->native_extension->create_instance(ti->native_extension->class_userdata); + } else { + return ti->creation_func(); } - return ti->creation_func(); } -Object *ClassDB::construct_object(Object *(*p_create_func)(), ObjectNativeExtension *p_extension) { - if (p_extension) { - initializing_with_extension = true; - initializing_extension = p_extension; - initializing_extension_instance = p_extension->create_instance(p_extension->class_userdata); +void ClassDB::set_object_extension_instance(Object *p_object, const StringName &p_class, GDExtensionClassInstancePtr p_instance) { + ERR_FAIL_COND(!p_object); + ClassInfo *ti; + { + OBJTYPE_RLOCK; + ti = classes.getptr(p_class); + if (!ti || ti->disabled || !ti->creation_func || (ti->native_extension && !ti->native_extension->create_instance)) { + if (compat_classes.has(p_class)) { + ti = classes.getptr(compat_classes[p_class]); + } + } + ERR_FAIL_COND_MSG(!ti, "Cannot get class '" + String(p_class) + "'."); + ERR_FAIL_COND_MSG(ti->disabled, "Class '" + String(p_class) + "' is disabled."); + ERR_FAIL_COND_MSG(!ti->native_extension, "Class '" + String(p_class) + "' has no native extension."); } - return p_create_func(); + + p_object->_extension = ti->native_extension; + p_object->_extension_instance = p_instance; } bool ClassDB::can_instantiate(const StringName &p_class) { diff --git a/core/object/class_db.h b/core/object/class_db.h index dae75ba564..ca9c1def29 100644 --- a/core/object/class_db.h +++ b/core/object/class_db.h @@ -211,8 +211,7 @@ public: static bool is_parent_class(const StringName &p_class, const StringName &p_inherits); static bool can_instantiate(const StringName &p_class); static Object *instantiate(const StringName &p_class); - static Object *construct_object(Object *(*p_create_func)(), ObjectNativeExtension *p_extension); - static void instance_get_native_extension_data(ObjectNativeExtension **r_extension, GDExtensionClassInstancePtr *r_extension_instance, Object *p_base); + static void set_object_extension_instance(Object *p_object, const StringName &p_class, GDExtensionClassInstancePtr p_instance); static APIType get_api_type(const StringName &p_class); diff --git a/core/object/make_virtuals.py b/core/object/make_virtuals.py index 86c2891e5d..e961745d96 100644 --- a/core/object/make_virtuals.py +++ b/core/object/make_virtuals.py @@ -1,7 +1,8 @@ proto = """ #define GDVIRTUAL$VER($RET m_name $ARG) \\ StringName _gdvirtual_##m_name##_sn = #m_name;\\ -GDNativeExtensionClassCallVirtual _gdvirtual_##m_name = (_get_extension() && _get_extension()->get_virtual) ? _get_extension()->get_virtual(_get_extension()->class_userdata, #m_name) : (GDNativeExtensionClassCallVirtual) nullptr;\\ +mutable bool _gdvirtual_##m_name##_initialized = false;\\ +mutable GDNativeExtensionClassCallVirtual _gdvirtual_##m_name = nullptr;\\ _FORCE_INLINE_ bool _gdvirtual_##m_name##_call($CALLARGS) $CONST { \\ ScriptInstance *script_instance = ((Object*)(this))->get_script_instance();\\ if (script_instance) {\\ @@ -13,6 +14,10 @@ _FORCE_INLINE_ bool _gdvirtual_##m_name##_call($CALLARGS) $CONST { \\ return true;\\ } \\ }\\ + if (unlikely(_get_extension() && !_gdvirtual_##m_name##_initialized)) {\\ + _gdvirtual_##m_name = (_get_extension() && _get_extension()->get_virtual) ? _get_extension()->get_virtual(_get_extension()->class_userdata, #m_name) : (GDNativeExtensionClassCallVirtual) nullptr;\\ + _gdvirtual_##m_name##_initialized = true;\\ + }\\ if (_gdvirtual_##m_name) {\\ $CALLPTRARGS\\ $CALLPTRRETDEF\\ @@ -28,6 +33,10 @@ _FORCE_INLINE_ bool _gdvirtual_##m_name##_overridden() const { \\ if (script_instance) {\\ return script_instance->has_method(_gdvirtual_##m_name##_sn);\\ }\\ + if (unlikely(_get_extension() && !_gdvirtual_##m_name##_initialized)) {\\ + _gdvirtual_##m_name = (_get_extension() && _get_extension()->get_virtual) ? _get_extension()->get_virtual(_get_extension()->class_userdata, #m_name) : (GDNativeExtensionClassCallVirtual) nullptr;\\ + _gdvirtual_##m_name##_initialized = true;\\ + }\\ if (_gdvirtual_##m_name) {\\ return true;\\ }\\ diff --git a/core/object/object.cpp b/core/object/object.cpp index 90bd697d37..3942dddf52 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -1838,8 +1838,6 @@ void Object::_construct_object(bool p_reference) { type_is_reference = p_reference; _instance_id = ObjectDB::add_instance(this); - ClassDB::instance_get_native_extension_data(&_extension, &_extension_instance, this); - #ifdef DEBUG_ENABLED _lock_index.init(1); #endif diff --git a/core/object/object.h b/core/object/object.h index 218bc26dec..795bbf27e8 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -284,7 +284,6 @@ struct ObjectNativeExtension { GDNativeExtensionClassCreateInstance create_instance; GDNativeExtensionClassFreeInstance free_instance; - GDNativeExtensionClassObjectInstance set_object_instance; GDNativeExtensionClassGetVirtual get_virtual; }; diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 055d5091c7..3145756511 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -105,15 +105,6 @@ </constant> </constants> <theme_items> - <theme_item name="disabled" data_type="style" type="StyleBox"> - [StyleBox] used when the [Button] is disabled. - </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [Button] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - [Font] of the [Button]'s text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default text [Color] of the [Button]. </theme_item> @@ -135,15 +126,6 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [Button] is being pressed. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the [Button]'s text. - </theme_item> - <theme_item name="hover" data_type="style" type="StyleBox"> - [StyleBox] used when the [Button] is being hovered. - </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="2"> - The horizontal space between [Button]'s icon and text. - </theme_item> <theme_item name="icon_disabled_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Icon modulate [Color] used when the [Button] is disabled. </theme_item> @@ -162,12 +144,30 @@ <theme_item name="icon_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Icon modulate [Color] used when the [Button] is being pressed. </theme_item> - <theme_item name="normal" data_type="style" type="StyleBox"> - Default [StyleBox] for the [Button]. + <theme_item name="hseparation" data_type="constant" type="int" default="2"> + The horizontal space between [Button]'s icon and text. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. </theme_item> + <theme_item name="font" data_type="font" type="Font"> + [Font] of the [Button]'s text. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the [Button]'s text. + </theme_item> + <theme_item name="disabled" data_type="style" type="StyleBox"> + [StyleBox] used when the [Button] is disabled. + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + [StyleBox] used when the [Button] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + </theme_item> + <theme_item name="hover" data_type="style" type="StyleBox"> + [StyleBox] used when the [Button] is being hovered. + </theme_item> + <theme_item name="normal" data_type="style" type="StyleBox"> + Default [StyleBox] for the [Button]. + </theme_item> <theme_item name="pressed" data_type="style" type="StyleBox"> [StyleBox] used when the [Button] is being pressed. </theme_item> diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 18f668a052..4604b952d7 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -14,24 +14,6 @@ <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" override="true" default="true" /> </members> <theme_items> - <theme_item name="check_vadjust" data_type="constant" type="int" default="0"> - The vertical offset used when rendering the check icons (in pixels). - </theme_item> - <theme_item name="checked" data_type="icon" type="Texture2D"> - The check icon to display when the [CheckBox] is checked. - </theme_item> - <theme_item name="checked_disabled" data_type="icon" type="Texture2D"> - The check icon to display when the [CheckBox] is checked and disabled. - </theme_item> - <theme_item name="disabled" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckBox] is disabled. - </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckBox] is focused. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - The [Font] to use for the [CheckBox] text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> The [CheckBox] text's font color. </theme_item> @@ -53,26 +35,26 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The [CheckBox] text's font color when it's pressed. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the [CheckBox]'s text. - </theme_item> - <theme_item name="hover" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckBox] is hovered. - </theme_item> - <theme_item name="hover_pressed" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckBox] is hovered and pressed. + <theme_item name="check_vadjust" data_type="constant" type="int" default="0"> + The vertical offset used when rendering the check icons (in pixels). </theme_item> <theme_item name="hseparation" data_type="constant" type="int" default="4"> The separation between the check icon and the text (in pixels). </theme_item> - <theme_item name="normal" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background. - </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. </theme_item> - <theme_item name="pressed" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckBox] is pressed. + <theme_item name="font" data_type="font" type="Font"> + The [Font] to use for the [CheckBox] text. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the [CheckBox]'s text. + </theme_item> + <theme_item name="checked" data_type="icon" type="Texture2D"> + The check icon to display when the [CheckBox] is checked. + </theme_item> + <theme_item name="checked_disabled" data_type="icon" type="Texture2D"> + The check icon to display when the [CheckBox] is checked and disabled. </theme_item> <theme_item name="radio_checked" data_type="icon" type="Texture2D"> If the [CheckBox] is configured as a radio button, the icon to display when the [CheckBox] is checked. @@ -90,5 +72,23 @@ <theme_item name="unchecked_disabled" data_type="icon" type="Texture2D"> The check icon to display when the [CheckBox] is unchecked and disabled. </theme_item> + <theme_item name="disabled" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background when the [CheckBox] is disabled. + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background when the [CheckBox] is focused. + </theme_item> + <theme_item name="hover" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background when the [CheckBox] is hovered. + </theme_item> + <theme_item name="hover_pressed" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background when the [CheckBox] is hovered and pressed. + </theme_item> + <theme_item name="normal" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background. + </theme_item> + <theme_item name="pressed" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background when the [CheckBox] is pressed. + </theme_item> </theme_items> </class> diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index c86fadb6b0..d880656d0a 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -14,18 +14,6 @@ <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" override="true" default="true" /> </members> <theme_items> - <theme_item name="check_vadjust" data_type="constant" type="int" default="0"> - The vertical offset used when rendering the toggle icons (in pixels). - </theme_item> - <theme_item name="disabled" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckButton] is disabled. - </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckButton] is focused. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - The [Font] to use for the [CheckButton] text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> The [CheckButton] text's font color. </theme_item> @@ -47,20 +35,20 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The [CheckButton] text's font color when it's pressed. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the [CheckButton]'s text. - </theme_item> - <theme_item name="hover" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckButton] is hovered. - </theme_item> - <theme_item name="hover_pressed" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background when the [CheckButton] is hovered and pressed. + <theme_item name="check_vadjust" data_type="constant" type="int" default="0"> + The vertical offset used when rendering the toggle icons (in pixels). </theme_item> <theme_item name="hseparation" data_type="constant" type="int" default="4"> The separation between the toggle icon and the text (in pixels). </theme_item> - <theme_item name="normal" data_type="style" type="StyleBox"> - The [StyleBox] to display as a background. + <theme_item name="outline_size" data_type="constant" type="int" default="0"> + The size of the text outline. + </theme_item> + <theme_item name="font" data_type="font" type="Font"> + The [Font] to use for the [CheckButton] text. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the [CheckButton]'s text. </theme_item> <theme_item name="off" data_type="icon" type="Texture2D"> The icon to display when the [CheckButton] is unchecked (for left-to-right layouts). @@ -86,8 +74,20 @@ <theme_item name="on_mirrored" data_type="icon" type="Texture2D"> The icon to display when the [CheckButton] is checked (for right-to-left layouts). </theme_item> - <theme_item name="outline_size" data_type="constant" type="int" default="0"> - The size of the text outline. + <theme_item name="disabled" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background when the [CheckButton] is disabled. + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background when the [CheckButton] is focused. + </theme_item> + <theme_item name="hover" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background when the [CheckButton] is hovered. + </theme_item> + <theme_item name="hover_pressed" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background when the [CheckButton] is hovered and pressed. + </theme_item> + <theme_item name="normal" data_type="style" type="StyleBox"> + The [StyleBox] to display as a background. </theme_item> <theme_item name="pressed" data_type="style" type="StyleBox"> The [StyleBox] to display as a background when the [CheckButton] is pressed. diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index bb1a4a79f0..4f42f2adbb 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -562,24 +562,15 @@ <theme_item name="background_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> Sets the background [Color]. </theme_item> - <theme_item name="bookmark" data_type="icon" type="Texture2D"> - Sets a custom [Texture2D] to draw in the bookmark gutter for bookmarked lines. - </theme_item> <theme_item name="bookmark_color" data_type="color" type="Color" default="Color(0.5, 0.64, 1, 0.8)"> [Color] of the bookmark icon for bookmarked lines. </theme_item> <theme_item name="brace_mismatch_color" data_type="color" type="Color" default="Color(1, 0.2, 0.2, 1)"> [Color] of the text to highlight mismatched braces. </theme_item> - <theme_item name="breakpoint" data_type="icon" type="Texture2D"> - Sets a custom [Texture2D] to draw in the breakpoint gutter for breakpointed lines. - </theme_item> <theme_item name="breakpoint_color" data_type="color" type="Color" default="Color(0.9, 0.29, 0.3, 1)"> [Color] of the breakpoint icon for bookmarked lines. </theme_item> - <theme_item name="can_fold" data_type="icon" type="Texture2D"> - Sets a custom [Texture2D] to draw in the line folding gutter when a line can be folded. - </theme_item> <theme_item name="caret_background_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> [Color] of the text behind the caret when block caret is enabled. </theme_item> @@ -589,9 +580,6 @@ <theme_item name="code_folding_color" data_type="color" type="Color" default="Color(0.8, 0.8, 0.8, 0.8)"> [Color] for all icons related to line folding. </theme_item> - <theme_item name="completion" data_type="style" type="StyleBox"> - [StyleBox] for the code completion popup. - </theme_item> <theme_item name="completion_background_color" data_type="color" type="Color" default="Color(0.17, 0.16, 0.2, 1)"> Sets the background [Color] for the code completion popup. </theme_item> @@ -601,42 +589,18 @@ <theme_item name="completion_font_color" data_type="color" type="Color" default="Color(0.67, 0.67, 0.67, 1)"> Font [Color] for the code completion popup. </theme_item> - <theme_item name="completion_lines" data_type="constant" type="int" default="7"> - Max number of options to display in the code completion popup at any one time. - </theme_item> - <theme_item name="completion_max_width" data_type="constant" type="int" default="50"> - Max width of options in the code completion popup. Options longer then this will be cut off. - </theme_item> <theme_item name="completion_scroll_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> [Color] of the scrollbar in the code completion popup. </theme_item> - <theme_item name="completion_scroll_width" data_type="constant" type="int" default="3"> - Width of the scrollbar in the code completion popup. - </theme_item> <theme_item name="completion_selected_color" data_type="color" type="Color" default="Color(0.26, 0.26, 0.27, 1)"> Background highlight [Color] for the current selected option item in the code completion popup. </theme_item> <theme_item name="current_line_color" data_type="color" type="Color" default="Color(0.25, 0.25, 0.26, 0.8)"> Background [Color] of the line containing the caret. </theme_item> - <theme_item name="executing_line" data_type="icon" type="Texture2D"> - Icon to draw in the executing gutter for executing lines. - </theme_item> <theme_item name="executing_line_color" data_type="color" type="Color" default="Color(0.98, 0.89, 0.27, 1)"> [Color] of the executing icon for executing lines. </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - Sets the [StyleBox] when in focus. - </theme_item> - <theme_item name="folded" data_type="icon" type="Texture2D"> - Sets a custom [Texture2D] to draw in the line folding gutter when a line is folded and can be unfolded. - </theme_item> - <theme_item name="folded_eol_icon" data_type="icon" type="Texture2D"> - Sets a custom [Texture2D] to draw at the end of a folded line. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - Sets the default [Font]. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Sets the font [Color]. </theme_item> @@ -649,35 +613,62 @@ <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> Sets the [Color] of the selected text. [member TextEdit.override_selected_font_color] has to be enabled. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Sets default font size. - </theme_item> <theme_item name="line_length_guideline_color" data_type="color" type="Color" default="Color(0.3, 0.5, 0.8, 0.1)"> [Color] of the main line length guideline, secondary guidelines will have 50% alpha applied. </theme_item> <theme_item name="line_number_color" data_type="color" type="Color" default="Color(0.67, 0.67, 0.67, 0.4)"> Sets the [Color] of line numbers. </theme_item> + <theme_item name="search_result_border_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 0.4)"> + [Color] of the border around text that matches the search query. + </theme_item> + <theme_item name="search_result_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 1)"> + [Color] behind the text that matches the search query. + </theme_item> + <theme_item name="selection_color" data_type="color" type="Color" default="Color(0.49, 0.49, 0.49, 1)"> + Sets the highlight [Color] of text selections. + </theme_item> + <theme_item name="word_highlighted_color" data_type="color" type="Color" default="Color(0.8, 0.9, 0.9, 0.15)"> + Sets the highlight [Color] of multiple occurrences. [member TextEdit.highlight_all_occurrences] has to be enabled. + </theme_item> + <theme_item name="completion_lines" data_type="constant" type="int" default="7"> + Max number of options to display in the code completion popup at any one time. + </theme_item> + <theme_item name="completion_max_width" data_type="constant" type="int" default="50"> + Max width of options in the code completion popup. Options longer then this will be cut off. + </theme_item> + <theme_item name="completion_scroll_width" data_type="constant" type="int" default="3"> + Width of the scrollbar in the code completion popup. + </theme_item> <theme_item name="line_spacing" data_type="constant" type="int" default="4"> Sets the spacing between the lines. </theme_item> - <theme_item name="normal" data_type="style" type="StyleBox"> - Sets the [StyleBox]. - </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. </theme_item> - <theme_item name="read_only" data_type="style" type="StyleBox"> - Sets the [StyleBox] when [member TextEdit.editable] is disabled. + <theme_item name="font" data_type="font" type="Font"> + Sets the default [Font]. </theme_item> - <theme_item name="search_result_border_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 0.4)"> - [Color] of the border around text that matches the search query. + <theme_item name="font_size" data_type="font_size" type="int"> + Sets default font size. </theme_item> - <theme_item name="search_result_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 1)"> - [Color] behind the text that matches the search query. + <theme_item name="bookmark" data_type="icon" type="Texture2D"> + Sets a custom [Texture2D] to draw in the bookmark gutter for bookmarked lines. </theme_item> - <theme_item name="selection_color" data_type="color" type="Color" default="Color(0.49, 0.49, 0.49, 1)"> - Sets the highlight [Color] of text selections. + <theme_item name="breakpoint" data_type="icon" type="Texture2D"> + Sets a custom [Texture2D] to draw in the breakpoint gutter for breakpointed lines. + </theme_item> + <theme_item name="can_fold" data_type="icon" type="Texture2D"> + Sets a custom [Texture2D] to draw in the line folding gutter when a line can be folded. + </theme_item> + <theme_item name="executing_line" data_type="icon" type="Texture2D"> + Icon to draw in the executing gutter for executing lines. + </theme_item> + <theme_item name="folded" data_type="icon" type="Texture2D"> + Sets a custom [Texture2D] to draw in the line folding gutter when a line is folded and can be unfolded. + </theme_item> + <theme_item name="folded_eol_icon" data_type="icon" type="Texture2D"> + Sets a custom [Texture2D] to draw at the end of a folded line. </theme_item> <theme_item name="space" data_type="icon" type="Texture2D"> Sets a custom [Texture2D] for space text characters. @@ -685,8 +676,17 @@ <theme_item name="tab" data_type="icon" type="Texture2D"> Sets a custom [Texture2D] for tab text characters. </theme_item> - <theme_item name="word_highlighted_color" data_type="color" type="Color" default="Color(0.8, 0.9, 0.9, 0.15)"> - Sets the highlight [Color] of multiple occurrences. [member TextEdit.highlight_all_occurrences] has to be enabled. + <theme_item name="completion" data_type="style" type="StyleBox"> + [StyleBox] for the code completion popup. + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + Sets the [StyleBox] when in focus. + </theme_item> + <theme_item name="normal" data_type="style" type="StyleBox"> + Sets the [StyleBox]. + </theme_item> + <theme_item name="read_only" data_type="style" type="StyleBox"> + Sets the [StyleBox] when [member TextEdit.editable] is disabled. </theme_item> </theme_items> </class> diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index fca6a7631a..22439f6ca5 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -93,6 +93,20 @@ </constant> </constants> <theme_items> + <theme_item name="h_width" data_type="constant" type="int" default="30"> + The width of the hue selection slider. + </theme_item> + <theme_item name="label_width" data_type="constant" type="int" default="10"> + </theme_item> + <theme_item name="margin" data_type="constant" type="int" default="4"> + The margin around the [ColorPicker]. + </theme_item> + <theme_item name="sv_height" data_type="constant" type="int" default="256"> + The height of the saturation-value selection box. + </theme_item> + <theme_item name="sv_width" data_type="constant" type="int" default="256"> + The width of the saturation-value selection box. + </theme_item> <theme_item name="add_preset" data_type="icon" type="Texture2D"> The icon for the "Add Preset" button. </theme_item> @@ -104,14 +118,6 @@ </theme_item> <theme_item name="color_sample" data_type="icon" type="Texture2D"> </theme_item> - <theme_item name="h_width" data_type="constant" type="int" default="30"> - The width of the hue selection slider. - </theme_item> - <theme_item name="label_width" data_type="constant" type="int" default="10"> - </theme_item> - <theme_item name="margin" data_type="constant" type="int" default="4"> - The margin around the [ColorPicker]. - </theme_item> <theme_item name="overbright_indicator" data_type="icon" type="Texture2D"> The indicator used to signalize that the color value is outside the 0-1 range. </theme_item> @@ -122,11 +128,5 @@ <theme_item name="screen_picker" data_type="icon" type="Texture2D"> The icon for the screen color picker button. </theme_item> - <theme_item name="sv_height" data_type="constant" type="int" default="256"> - The height of the saturation-value selection box. - </theme_item> - <theme_item name="sv_width" data_type="constant" type="int" default="256"> - The width of the saturation-value selection box. - </theme_item> </theme_items> </class> diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index fff27d2d56..351591b24d 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -56,18 +56,6 @@ </signal> </signals> <theme_items> - <theme_item name="bg" data_type="icon" type="Texture2D"> - The background of the color preview rect on the button. - </theme_item> - <theme_item name="disabled" data_type="style" type="StyleBox"> - [StyleBox] used when the [ColorPickerButton] is disabled. - </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [ColorPickerButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - [Font] of the [ColorPickerButton]'s text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Default text [Color] of the [ColorPickerButton]. </theme_item> @@ -86,21 +74,33 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(0.8, 0.8, 0.8, 1)"> Text [Color] used when the [ColorPickerButton] is being pressed. </theme_item> + <theme_item name="hseparation" data_type="constant" type="int" default="2"> + The horizontal space between [ColorPickerButton]'s icon and text. + </theme_item> + <theme_item name="outline_size" data_type="constant" type="int" default="0"> + The size of the text outline. + </theme_item> + <theme_item name="font" data_type="font" type="Font"> + [Font] of the [ColorPickerButton]'s text. + </theme_item> <theme_item name="font_size" data_type="font_size" type="int"> Font size of the [ColorPickerButton]'s text. </theme_item> + <theme_item name="bg" data_type="icon" type="Texture2D"> + The background of the color preview rect on the button. + </theme_item> + <theme_item name="disabled" data_type="style" type="StyleBox"> + [StyleBox] used when the [ColorPickerButton] is disabled. + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + [StyleBox] used when the [ColorPickerButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + </theme_item> <theme_item name="hover" data_type="style" type="StyleBox"> [StyleBox] used when the [ColorPickerButton] is being hovered. </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="2"> - The horizontal space between [ColorPickerButton]'s icon and text. - </theme_item> <theme_item name="normal" data_type="style" type="StyleBox"> Default [StyleBox] for the [ColorPickerButton]. </theme_item> - <theme_item name="outline_size" data_type="constant" type="int" default="0"> - The size of the text outline. - </theme_item> <theme_item name="pressed" data_type="style" type="StyleBox"> [StyleBox] used when the [ColorPickerButton] is being pressed. </theme_item> diff --git a/doc/classes/EditorNode3DGizmo.xml b/doc/classes/EditorNode3DGizmo.xml index c804bb70e0..60c329935a 100644 --- a/doc/classes/EditorNode3DGizmo.xml +++ b/doc/classes/EditorNode3DGizmo.xml @@ -135,7 +135,7 @@ </method> <method name="add_mesh"> <return type="void" /> - <argument index="0" name="mesh" type="ArrayMesh" /> + <argument index="0" name="mesh" type="Mesh" /> <argument index="1" name="material" type="Material" default="null" /> <argument index="2" name="transform" type="Transform3D" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)" /> <argument index="3" name="skeleton" type="SkinReference" default="null" /> diff --git a/doc/classes/File.xml b/doc/classes/File.xml index 276c1f0223..0dac9a379a 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -417,6 +417,7 @@ <argument index="0" name="string" type="String" /> <description> Appends [code]string[/code] to the file without a line return, encoding the text as UTF-8. + [b]Note:[/b] This method is intended to be used to write text files. The string is stored as a UTF-8 encoded buffer without string length or terminating zero, which means that it can't be loaded back easily. If you want to store a retrievable string in a binary file, consider using [method store_pascal_string] instead. For retrieving strings from a text file, you can use [code]get_buffer(length).get_string_from_utf8()[/code] (if you know the length) or [method get_as_text]. </description> </method> <method name="store_var"> diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index fa43f97104..b3c2d67ef5 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -125,24 +125,24 @@ </constant> </constants> <theme_items> - <theme_item name="back_folder" data_type="icon" type="Texture2D"> - Custom icon for the back arrow. - </theme_item> - <theme_item name="file" data_type="icon" type="Texture2D"> - Custom icon for files. - </theme_item> <theme_item name="file_icon_modulate" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The color modulation applied to the file icon. </theme_item> <theme_item name="files_disabled" data_type="color" type="Color" default="Color(0, 0, 0, 0.7)"> The color tint for disabled files (when the [FileDialog] is used in open folder mode). </theme_item> - <theme_item name="folder" data_type="icon" type="Texture2D"> - Custom icon for folders. - </theme_item> <theme_item name="folder_icon_modulate" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The color modulation applied to the folder icon. </theme_item> + <theme_item name="back_folder" data_type="icon" type="Texture2D"> + Custom icon for the back arrow. + </theme_item> + <theme_item name="file" data_type="icon" type="Texture2D"> + Custom icon for files. + </theme_item> + <theme_item name="folder" data_type="icon" type="Texture2D"> + Custom icon for folders. + </theme_item> <theme_item name="forward_folder" data_type="icon" type="Texture2D"> Custom icon for the forward arrow. </theme_item> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index e962992491..df599a95c7 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -290,28 +290,21 @@ <theme_items> <theme_item name="activity" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> </theme_item> - <theme_item name="bezier_len_neg" data_type="constant" type="int" default="160"> - </theme_item> - <theme_item name="bezier_len_pos" data_type="constant" type="int" default="80"> - </theme_item> - <theme_item name="bg" data_type="style" type="StyleBox"> - The background drawn under the grid. - </theme_item> <theme_item name="grid_major" data_type="color" type="Color" default="Color(1, 1, 1, 0.2)"> Color of major grid lines. </theme_item> <theme_item name="grid_minor" data_type="color" type="Color" default="Color(1, 1, 1, 0.05)"> Color of minor grid lines. </theme_item> - <theme_item name="layout" data_type="icon" type="Texture2D"> + <theme_item name="selection_fill" data_type="color" type="Color" default="Color(1, 1, 1, 0.3)"> + The fill color of the selection rectangle. </theme_item> - <theme_item name="minimap" data_type="icon" type="Texture2D"> + <theme_item name="selection_stroke" data_type="color" type="Color" default="Color(1, 1, 1, 0.8)"> + The outline color of the selection rectangle. </theme_item> - <theme_item name="minus" data_type="icon" type="Texture2D"> - The icon for the zoom out button. + <theme_item name="bezier_len_neg" data_type="constant" type="int" default="160"> </theme_item> - <theme_item name="more" data_type="icon" type="Texture2D"> - The icon for the zoom in button. + <theme_item name="bezier_len_pos" data_type="constant" type="int" default="80"> </theme_item> <theme_item name="port_grab_distance_horizontal" data_type="constant" type="int" default="24"> The horizontal range within which a port can be grabbed (on both sides). @@ -319,17 +312,24 @@ <theme_item name="port_grab_distance_vertical" data_type="constant" type="int" default="6"> The vertical range within which a port can be grabbed (on both sides). </theme_item> - <theme_item name="reset" data_type="icon" type="Texture2D"> - The icon for the zoom reset button. + <theme_item name="layout" data_type="icon" type="Texture2D"> </theme_item> - <theme_item name="selection_fill" data_type="color" type="Color" default="Color(1, 1, 1, 0.3)"> - The fill color of the selection rectangle. + <theme_item name="minimap" data_type="icon" type="Texture2D"> </theme_item> - <theme_item name="selection_stroke" data_type="color" type="Color" default="Color(1, 1, 1, 0.8)"> - The outline color of the selection rectangle. + <theme_item name="minus" data_type="icon" type="Texture2D"> + The icon for the zoom out button. + </theme_item> + <theme_item name="more" data_type="icon" type="Texture2D"> + The icon for the zoom in button. + </theme_item> + <theme_item name="reset" data_type="icon" type="Texture2D"> + The icon for the zoom reset button. </theme_item> <theme_item name="snap" data_type="icon" type="Texture2D"> The icon for the snap toggle button. </theme_item> + <theme_item name="bg" data_type="style" type="StyleBox"> + The background drawn under the grid. + </theme_item> </theme_items> </class> diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index e9226f7c1d..59ae88978e 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -292,18 +292,42 @@ </constant> </constants> <theme_items> - <theme_item name="breakpoint" data_type="style" type="StyleBox"> - The background used when [member overlay] is set to [constant OVERLAY_BREAKPOINT]. - </theme_item> - <theme_item name="close" data_type="icon" type="Texture2D"> - The icon for the close button, visible when [member show_close] is enabled. - </theme_item> <theme_item name="close_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> The color modulation applied to the close button icon. </theme_item> + <theme_item name="resizer_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> + The color modulation applied to the resizer icon. + </theme_item> + <theme_item name="title_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> + Color of the title text. + </theme_item> <theme_item name="close_offset" data_type="constant" type="int" default="18"> The vertical offset of the close button. </theme_item> + <theme_item name="port_offset" data_type="constant" type="int" default="3"> + Horizontal offset for the ports. + </theme_item> + <theme_item name="separation" data_type="constant" type="int" default="1"> + The vertical distance between ports. + </theme_item> + <theme_item name="title_offset" data_type="constant" type="int" default="20"> + Vertical offset of the title text. + </theme_item> + <theme_item name="title_font" data_type="font" type="Font"> + Font used for the title text. + </theme_item> + <theme_item name="close" data_type="icon" type="Texture2D"> + The icon for the close button, visible when [member show_close] is enabled. + </theme_item> + <theme_item name="port" data_type="icon" type="Texture2D"> + The icon used for representing ports. + </theme_item> + <theme_item name="resizer" data_type="icon" type="Texture2D"> + The icon used for resizer, visible when [member resizable] is enabled. + </theme_item> + <theme_item name="breakpoint" data_type="style" type="StyleBox"> + The background used when [member overlay] is set to [constant OVERLAY_BREAKPOINT]. + </theme_item> <theme_item name="comment" data_type="style" type="StyleBox"> The [StyleBox] used when [member comment] is enabled. </theme_item> @@ -317,35 +341,11 @@ <theme_item name="frame" data_type="style" type="StyleBox"> The default background for [GraphNode]. </theme_item> - <theme_item name="port" data_type="icon" type="Texture2D"> - The icon used for representing ports. - </theme_item> - <theme_item name="port_offset" data_type="constant" type="int" default="3"> - Horizontal offset for the ports. - </theme_item> <theme_item name="position" data_type="style" type="StyleBox"> The background used when [member overlay] is set to [constant OVERLAY_POSITION]. </theme_item> - <theme_item name="resizer" data_type="icon" type="Texture2D"> - The icon used for resizer, visible when [member resizable] is enabled. - </theme_item> - <theme_item name="resizer_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> - The color modulation applied to the resizer icon. - </theme_item> <theme_item name="selectedframe" data_type="style" type="StyleBox"> The background used when the [GraphNode] is selected. </theme_item> - <theme_item name="separation" data_type="constant" type="int" default="1"> - The vertical distance between ports. - </theme_item> - <theme_item name="title_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> - Color of the title text. - </theme_item> - <theme_item name="title_font" data_type="font" type="Font"> - Font used for the title text. - </theme_item> - <theme_item name="title_offset" data_type="constant" type="int" default="20"> - Vertical offset of the title text. - </theme_item> </theme_items> </class> diff --git a/doc/classes/HScrollBar.xml b/doc/classes/HScrollBar.xml index fa9961710f..3197abcc3f 100644 --- a/doc/classes/HScrollBar.xml +++ b/doc/classes/HScrollBar.xml @@ -18,15 +18,6 @@ <theme_item name="decrement_pressed" data_type="icon" type="Texture2D"> Displayed when the decrement button is being pressed. </theme_item> - <theme_item name="grabber" data_type="style" type="StyleBox"> - Used as texture for the grabber, the draggable element representing current scroll. - </theme_item> - <theme_item name="grabber_highlight" data_type="style" type="StyleBox"> - Used when the mouse hovers over the grabber. - </theme_item> - <theme_item name="grabber_pressed" data_type="style" type="StyleBox"> - Used when the grabber is being dragged. - </theme_item> <theme_item name="increment" data_type="icon" type="Texture2D"> Icon used as a button to scroll the [ScrollBar] right. Supports custom step using the [member ScrollBar.custom_step] property. </theme_item> @@ -36,6 +27,15 @@ <theme_item name="increment_pressed" data_type="icon" type="Texture2D"> Displayed when the increment button is being pressed. </theme_item> + <theme_item name="grabber" data_type="style" type="StyleBox"> + Used as texture for the grabber, the draggable element representing current scroll. + </theme_item> + <theme_item name="grabber_highlight" data_type="style" type="StyleBox"> + Used when the mouse hovers over the grabber. + </theme_item> + <theme_item name="grabber_pressed" data_type="style" type="StyleBox"> + Used when the grabber is being dragged. + </theme_item> <theme_item name="scroll" data_type="style" type="StyleBox"> Used as background of this [ScrollBar]. </theme_item> diff --git a/doc/classes/HSlider.xml b/doc/classes/HSlider.xml index fa88085a70..1b83731a32 100644 --- a/doc/classes/HSlider.xml +++ b/doc/classes/HSlider.xml @@ -13,22 +13,22 @@ <theme_item name="grabber" data_type="icon" type="Texture2D"> The texture for the grabber (the draggable element). </theme_item> - <theme_item name="grabber_area" data_type="style" type="StyleBox"> - The background of the area to the left of the grabber. - </theme_item> - <theme_item name="grabber_area_highlight" data_type="style" type="StyleBox"> - </theme_item> <theme_item name="grabber_disabled" data_type="icon" type="Texture2D"> The texture for the grabber when it's disabled. </theme_item> <theme_item name="grabber_highlight" data_type="icon" type="Texture2D"> The texture for the grabber when it's focused. </theme_item> - <theme_item name="slider" data_type="style" type="StyleBox"> - The background for the whole slider. Determines the height of the [code]grabber_area[/code]. - </theme_item> <theme_item name="tick" data_type="icon" type="Texture2D"> The texture for the ticks, visible when [member Slider.tick_count] is greater than 0. </theme_item> + <theme_item name="grabber_area" data_type="style" type="StyleBox"> + The background of the area to the left of the grabber. + </theme_item> + <theme_item name="grabber_area_highlight" data_type="style" type="StyleBox"> + </theme_item> + <theme_item name="slider" data_type="style" type="StyleBox"> + The background for the whole slider. Determines the height of the [code]grabber_area[/code]. + </theme_item> </theme_items> </class> diff --git a/doc/classes/HSplitContainer.xml b/doc/classes/HSplitContainer.xml index 379d4cfbdb..f2c505b1bc 100644 --- a/doc/classes/HSplitContainer.xml +++ b/doc/classes/HSplitContainer.xml @@ -12,13 +12,13 @@ <theme_item name="autohide" data_type="constant" type="int" default="1"> Boolean value. If 1 ([code]true[/code]), the grabber will hide automatically when it isn't under the cursor. If 0 ([code]false[/code]), it's always visible. </theme_item> - <theme_item name="bg" data_type="style" type="StyleBox"> + <theme_item name="separation" data_type="constant" type="int" default="12"> + The space between sides of the container. </theme_item> <theme_item name="grabber" data_type="icon" type="Texture2D"> The icon used for the grabber drawn in the middle area. </theme_item> - <theme_item name="separation" data_type="constant" type="int" default="12"> - The space between sides of the container. + <theme_item name="bg" data_type="style" type="StyleBox"> </theme_item> </theme_items> </class> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index baa0faaae9..647b9aad0b 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -463,21 +463,6 @@ </constant> </constants> <theme_items> - <theme_item name="bg" data_type="style" type="StyleBox"> - Default [StyleBox] for the [ItemList], i.e. used when the control is not being focused. - </theme_item> - <theme_item name="bg_focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [ItemList] is being focused. - </theme_item> - <theme_item name="cursor" data_type="style" type="StyleBox"> - [StyleBox] used for the cursor, when the [ItemList] is being focused. - </theme_item> - <theme_item name="cursor_unfocused" data_type="style" type="StyleBox"> - [StyleBox] used for the cursor, when the [ItemList] is not being focused. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - [Font] of the item's text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.63, 0.63, 0.63, 1)"> Default text [Color] of the item. </theme_item> @@ -487,9 +472,6 @@ <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the item is selected. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the item's text. - </theme_item> <theme_item name="guide_color" data_type="color" type="Color" default="Color(0, 0, 0, 0.1)"> [Color] of the guideline. The guideline is a line drawn between each row of items. </theme_item> @@ -505,14 +487,32 @@ <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the item text outline. </theme_item> + <theme_item name="vseparation" data_type="constant" type="int" default="2"> + The vertical spacing between items. + </theme_item> + <theme_item name="font" data_type="font" type="Font"> + [Font] of the item's text. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the item's text. + </theme_item> + <theme_item name="bg" data_type="style" type="StyleBox"> + Default [StyleBox] for the [ItemList], i.e. used when the control is not being focused. + </theme_item> + <theme_item name="bg_focus" data_type="style" type="StyleBox"> + [StyleBox] used when the [ItemList] is being focused. + </theme_item> + <theme_item name="cursor" data_type="style" type="StyleBox"> + [StyleBox] used for the cursor, when the [ItemList] is being focused. + </theme_item> + <theme_item name="cursor_unfocused" data_type="style" type="StyleBox"> + [StyleBox] used for the cursor, when the [ItemList] is not being focused. + </theme_item> <theme_item name="selected" data_type="style" type="StyleBox"> [StyleBox] for the selected items, used when the [ItemList] is not being focused. </theme_item> <theme_item name="selected_focus" data_type="style" type="StyleBox"> [StyleBox] for the selected items, used when the [ItemList] is being focused. </theme_item> - <theme_item name="vseparation" data_type="constant" type="int" default="2"> - The vertical spacing between items. - </theme_item> </theme_items> </class> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index 24ebf08c36..f25795b7df 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -163,9 +163,6 @@ </constant> </constants> <theme_items> - <theme_item name="font" data_type="font" type="Font"> - [Font] used for the [Label]'s text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Default text [Color] of the [Label]. </theme_item> @@ -175,15 +172,9 @@ <theme_item name="font_shadow_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> [Color] of the text's shadow effect. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the [Label]'s text. - </theme_item> <theme_item name="line_spacing" data_type="constant" type="int" default="3"> Vertical space between lines in multiline [Label]. </theme_item> - <theme_item name="normal" data_type="style" type="StyleBox"> - Background [StyleBox] for the [Label]. - </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> Text outline size. </theme_item> @@ -196,5 +187,14 @@ <theme_item name="shadow_outline_size" data_type="constant" type="int" default="1"> The size of the shadow outline. </theme_item> + <theme_item name="font" data_type="font" type="Font"> + [Font] used for the [Label]'s text. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the [Label]'s text. + </theme_item> + <theme_item name="normal" data_type="style" type="StyleBox"> + Background [StyleBox] for the [Label]. + </theme_item> </theme_items> </class> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index a75bd2f704..614f2fd9e4 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -397,21 +397,12 @@ <theme_item name="caret_color" data_type="color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Color of the [LineEdit]'s caret (text cursor). </theme_item> - <theme_item name="clear" data_type="icon" type="Texture2D"> - Texture for the clear button. See [member clear_button_enabled]. - </theme_item> <theme_item name="clear_button_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Color used as default tint for the clear button. </theme_item> <theme_item name="clear_button_color_pressed" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Color used for the clear button when it's pressed. </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - Background used when [LineEdit] has GUI focus. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - Font used for the text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default font color. </theme_item> @@ -421,26 +412,35 @@ <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> Font color for selected text (inside the selection rectangle). </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the [LineEdit]'s text. - </theme_item> <theme_item name="font_uneditable_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 0.5)"> Font color when editing is disabled. </theme_item> + <theme_item name="selection_color" data_type="color" type="Color" default="Color(0.49, 0.49, 0.49, 1)"> + Color of the selection rectangle. + </theme_item> <theme_item name="minimum_character_width" data_type="constant" type="int" default="4"> Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of 'M' characters (i.e. this amount of 'M' characters can be displayed without scrolling). </theme_item> - <theme_item name="normal" data_type="style" type="StyleBox"> - Default background for the [LineEdit]. - </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. </theme_item> + <theme_item name="font" data_type="font" type="Font"> + Font used for the text. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the [LineEdit]'s text. + </theme_item> + <theme_item name="clear" data_type="icon" type="Texture2D"> + Texture for the clear button. See [member clear_button_enabled]. + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + Background used when [LineEdit] has GUI focus. + </theme_item> + <theme_item name="normal" data_type="style" type="StyleBox"> + Default background for the [LineEdit]. + </theme_item> <theme_item name="read_only" data_type="style" type="StyleBox"> Background used when [LineEdit] is in read-only mode ([member editable] is set to [code]false[/code]). </theme_item> - <theme_item name="selection_color" data_type="color" type="Color" default="Color(0.49, 0.49, 0.49, 1)"> - Color of the selection rectangle. - </theme_item> </theme_items> </class> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 0329ed833f..d70c7393ca 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -66,12 +66,6 @@ </constant> </constants> <theme_items> - <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [LinkButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - [Font] of the [LinkButton]'s text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default text [Color] of the [LinkButton]. </theme_item> @@ -87,14 +81,20 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [LinkButton] is being pressed. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the [LinkButton]'s text. - </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. </theme_item> <theme_item name="underline_spacing" data_type="constant" type="int" default="2"> The vertical space between the baseline of text and the underline. </theme_item> + <theme_item name="font" data_type="font" type="Font"> + [Font] of the [LinkButton]'s text. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the [LinkButton]'s text. + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + [StyleBox] used when the [LinkButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + </theme_item> </theme_items> </class> diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 7f9d3d96dc..79ca1972ca 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -46,15 +46,6 @@ </signal> </signals> <theme_items> - <theme_item name="disabled" data_type="style" type="StyleBox"> - [StyleBox] used when the [MenuButton] is disabled. - </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [MenuButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - [Font] of the [MenuButton]'s text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default text [Color] of the [MenuButton]. </theme_item> @@ -73,21 +64,30 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [MenuButton] is being pressed. </theme_item> + <theme_item name="hseparation" data_type="constant" type="int" default="3"> + The horizontal space between [MenuButton]'s icon and text. + </theme_item> + <theme_item name="outline_size" data_type="constant" type="int" default="0"> + The size of the text outline. + </theme_item> + <theme_item name="font" data_type="font" type="Font"> + [Font] of the [MenuButton]'s text. + </theme_item> <theme_item name="font_size" data_type="font_size" type="int"> Font size of the [MenuButton]'s text. </theme_item> + <theme_item name="disabled" data_type="style" type="StyleBox"> + [StyleBox] used when the [MenuButton] is disabled. + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + [StyleBox] used when the [MenuButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + </theme_item> <theme_item name="hover" data_type="style" type="StyleBox"> [StyleBox] used when the [MenuButton] is being hovered. </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="3"> - The horizontal space between [MenuButton]'s icon and text. - </theme_item> <theme_item name="normal" data_type="style" type="StyleBox"> Default [StyleBox] for the [MenuButton]. </theme_item> - <theme_item name="outline_size" data_type="constant" type="int" default="0"> - The size of the text outline. - </theme_item> <theme_item name="pressed" data_type="style" type="StyleBox"> [StyleBox] used when the [MenuButton] is being pressed. </theme_item> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index a3616af999..750ab401d1 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -185,24 +185,6 @@ </signal> </signals> <theme_items> - <theme_item name="arrow" data_type="icon" type="Texture2D"> - The arrow icon to be drawn on the right end of the button. - </theme_item> - <theme_item name="arrow_margin" data_type="constant" type="int" default="2"> - The horizontal space between the arrow icon and the right edge of the button. - </theme_item> - <theme_item name="disabled" data_type="style" type="StyleBox"> - [StyleBox] used when the [OptionButton] is disabled (for left-to-right layouts). - </theme_item> - <theme_item name="disabled_mirrored" data_type="style" type="StyleBox"> - [StyleBox] used when the [OptionButton] is disabled (for right-to-left layouts). - </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [OptionButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - [Font] of the [OptionButton]'s text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Default text [Color] of the [OptionButton]. </theme_item> @@ -221,27 +203,45 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [OptionButton] is being pressed. </theme_item> + <theme_item name="arrow_margin" data_type="constant" type="int" default="2"> + The horizontal space between the arrow icon and the right edge of the button. + </theme_item> + <theme_item name="hseparation" data_type="constant" type="int" default="2"> + The horizontal space between [OptionButton]'s icon and text. + </theme_item> + <theme_item name="outline_size" data_type="constant" type="int" default="0"> + The size of the text outline. + </theme_item> + <theme_item name="font" data_type="font" type="Font"> + [Font] of the [OptionButton]'s text. + </theme_item> <theme_item name="font_size" data_type="font_size" type="int"> Font size of the [OptionButton]'s text. </theme_item> + <theme_item name="arrow" data_type="icon" type="Texture2D"> + The arrow icon to be drawn on the right end of the button. + </theme_item> + <theme_item name="disabled" data_type="style" type="StyleBox"> + [StyleBox] used when the [OptionButton] is disabled (for left-to-right layouts). + </theme_item> + <theme_item name="disabled_mirrored" data_type="style" type="StyleBox"> + [StyleBox] used when the [OptionButton] is disabled (for right-to-left layouts). + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + [StyleBox] used when the [OptionButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + </theme_item> <theme_item name="hover" data_type="style" type="StyleBox"> [StyleBox] used when the [OptionButton] is being hovered (for left-to-right layouts). </theme_item> <theme_item name="hover_mirrored" data_type="style" type="StyleBox"> [StyleBox] used when the [OptionButton] is being hovered (for right-to-left layouts). </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="2"> - The horizontal space between [OptionButton]'s icon and text. - </theme_item> <theme_item name="normal" data_type="style" type="StyleBox"> Default [StyleBox] for the [OptionButton] (for left-to-right layouts). </theme_item> <theme_item name="normal_mirrored" data_type="style" type="StyleBox"> Default [StyleBox] for the [OptionButton] (for right-to-left layouts). </theme_item> - <theme_item name="outline_size" data_type="constant" type="int" default="0"> - The size of the text outline. - </theme_item> <theme_item name="pressed" data_type="style" type="StyleBox"> [StyleBox] used when the [OptionButton] is being pressed (for left-to-right layouts). </theme_item> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 4eb3ef34b4..b377b186f6 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -533,12 +533,6 @@ </signal> </signals> <theme_items> - <theme_item name="checked" data_type="icon" type="Texture2D"> - [Texture2D] icon for the checked checkbox items. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - [Font] used for the menu items. - </theme_item> <theme_item name="font_accelerator_color" data_type="color" type="Color" default="Color(0.7, 0.7, 0.7, 0.8)"> The text [Color] used for shortcuts and accelerators that show next to the menu item name when defined. See [method get_item_accelerator] for more info on accelerators. </theme_item> @@ -557,12 +551,6 @@ <theme_item name="font_separator_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> [Color] used for labeled separators' text. See [method add_separator]. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the menu items. - </theme_item> - <theme_item name="hover" data_type="style" type="StyleBox"> - [StyleBox] displayed when the [PopupMenu] item is hovered. - </theme_item> <theme_item name="hseparation" data_type="constant" type="int" default="4"> The horizontal space between the item's name and the shortcut text/submenu arrow. </theme_item> @@ -570,20 +558,20 @@ </theme_item> <theme_item name="item_start_padding" data_type="constant" type="int" default="2"> </theme_item> - <theme_item name="labeled_separator_left" data_type="style" type="StyleBox"> - [StyleBox] for the left side of labeled separator. See [method add_separator]. - </theme_item> - <theme_item name="labeled_separator_right" data_type="style" type="StyleBox"> - [StyleBox] for the right side of labeled separator. See [method add_separator]. - </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the item text outline. </theme_item> - <theme_item name="panel" data_type="style" type="StyleBox"> - Default [StyleBox] of the [PopupMenu] items. + <theme_item name="vseparation" data_type="constant" type="int" default="4"> + The vertical space between each menu item. </theme_item> - <theme_item name="panel_disabled" data_type="style" type="StyleBox"> - [StyleBox] used when the [PopupMenu] item is disabled. + <theme_item name="font" data_type="font" type="Font"> + [Font] used for the menu items. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the menu items. + </theme_item> + <theme_item name="checked" data_type="icon" type="Texture2D"> + [Texture2D] icon for the checked checkbox items. </theme_item> <theme_item name="radio_checked" data_type="icon" type="Texture2D"> [Texture2D] icon for the checked radio button items. @@ -591,9 +579,6 @@ <theme_item name="radio_unchecked" data_type="icon" type="Texture2D"> [Texture2D] icon for the unchecked radio button items. </theme_item> - <theme_item name="separator" data_type="style" type="StyleBox"> - [StyleBox] used for the separators. See [method add_separator]. - </theme_item> <theme_item name="submenu" data_type="icon" type="Texture2D"> [Texture2D] icon for the submenu arrow (for left-to-right layouts). </theme_item> @@ -603,8 +588,23 @@ <theme_item name="unchecked" data_type="icon" type="Texture2D"> [Texture2D] icon for the unchecked checkbox items. </theme_item> - <theme_item name="vseparation" data_type="constant" type="int" default="4"> - The vertical space between each menu item. + <theme_item name="hover" data_type="style" type="StyleBox"> + [StyleBox] displayed when the [PopupMenu] item is hovered. + </theme_item> + <theme_item name="labeled_separator_left" data_type="style" type="StyleBox"> + [StyleBox] for the left side of labeled separator. See [method add_separator]. + </theme_item> + <theme_item name="labeled_separator_right" data_type="style" type="StyleBox"> + [StyleBox] for the right side of labeled separator. See [method add_separator]. + </theme_item> + <theme_item name="panel" data_type="style" type="StyleBox"> + Default [StyleBox] of the [PopupMenu] items. + </theme_item> + <theme_item name="panel_disabled" data_type="style" type="StyleBox"> + [StyleBox] used when the [PopupMenu] item is disabled. + </theme_item> + <theme_item name="separator" data_type="style" type="StyleBox"> + [StyleBox] used for the separators. See [method add_separator]. </theme_item> </theme_items> </class> diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml index 88132967a0..763ab6c794 100644 --- a/doc/classes/ProgressBar.xml +++ b/doc/classes/ProgressBar.xml @@ -16,15 +16,6 @@ <member name="step" type="float" setter="set_step" getter="get_step" override="true" default="0.01" /> </members> <theme_items> - <theme_item name="bg" data_type="style" type="StyleBox"> - The style of the background. - </theme_item> - <theme_item name="fg" data_type="style" type="StyleBox"> - The style of the progress (i.e. the part that fills the bar). - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - Font used to draw the fill percentage if [member percent_visible] is [code]true[/code]. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> The color of the text. </theme_item> @@ -34,11 +25,20 @@ <theme_item name="font_shadow_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> The color of the text's shadow. </theme_item> + <theme_item name="outline_size" data_type="constant" type="int" default="0"> + The size of the text outline. + </theme_item> + <theme_item name="font" data_type="font" type="Font"> + Font used to draw the fill percentage if [member percent_visible] is [code]true[/code]. + </theme_item> <theme_item name="font_size" data_type="font_size" type="int"> Font size used to draw the fill percentage if [member percent_visible] is [code]true[/code]. </theme_item> - <theme_item name="outline_size" data_type="constant" type="int" default="0"> - The size of the text outline. + <theme_item name="bg" data_type="style" type="StyleBox"> + The style of the background. + </theme_item> + <theme_item name="fg" data_type="style" type="StyleBox"> + The style of the progress (i.e. the part that fills the bar). </theme_item> </theme_items> </class> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 6bfaca8928..006b2de341 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -529,24 +529,9 @@ </constant> </constants> <theme_items> - <theme_item name="bold_font" data_type="font" type="Font"> - The font used for bold text. - </theme_item> - <theme_item name="bold_font_size" data_type="font_size" type="int"> - The font size used for bold text. - </theme_item> - <theme_item name="bold_italics_font" data_type="font" type="Font"> - The font used for bold italics text. - </theme_item> - <theme_item name="bold_italics_font_size" data_type="font_size" type="int"> - The font size used for bold italics text. - </theme_item> <theme_item name="default_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The default text color. </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - The background The background used when the [RichTextLabel] is focused. - </theme_item> <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The default tint of text outline. </theme_item> @@ -556,36 +541,24 @@ <theme_item name="font_shadow_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> The color of the font's shadow. </theme_item> - <theme_item name="italics_font" data_type="font" type="Font"> - The font used for italics text. - </theme_item> - <theme_item name="italics_font_size" data_type="font_size" type="int"> - The font size used for italics text. - </theme_item> - <theme_item name="line_separation" data_type="constant" type="int" default="0"> - The vertical space between lines. - </theme_item> - <theme_item name="mono_font" data_type="font" type="Font"> - The font used for monospace text. + <theme_item name="selection_color" data_type="color" type="Color" default="Color(0.1, 0.1, 1, 0.8)"> + The color of the selection box. </theme_item> - <theme_item name="mono_font_size" data_type="font_size" type="int"> - The font size used for monospace text. + <theme_item name="table_border" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> + The default cell border color. </theme_item> - <theme_item name="normal" data_type="style" type="StyleBox"> - The normal background for the [RichTextLabel]. + <theme_item name="table_even_row_bg" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> + The default background color for even rows. </theme_item> - <theme_item name="normal_font" data_type="font" type="Font"> - The default text font. + <theme_item name="table_odd_row_bg" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> + The default background color for odd rows. </theme_item> - <theme_item name="normal_font_size" data_type="font_size" type="int"> - The default text font size. + <theme_item name="line_separation" data_type="constant" type="int" default="0"> + The vertical space between lines. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. </theme_item> - <theme_item name="selection_color" data_type="color" type="Color" default="Color(0.1, 0.1, 1, 0.8)"> - The color of the selection box. - </theme_item> <theme_item name="shadow_offset_x" data_type="constant" type="int" default="1"> The horizontal offset of the font's shadow. </theme_item> @@ -595,20 +568,47 @@ <theme_item name="shadow_outline_size" data_type="constant" type="int" default="1"> The size of the shadow outline. </theme_item> - <theme_item name="table_border" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> - The default cell border color. - </theme_item> - <theme_item name="table_even_row_bg" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> - The default background color for even rows. - </theme_item> <theme_item name="table_hseparation" data_type="constant" type="int" default="3"> The horizontal separation of elements in a table. </theme_item> - <theme_item name="table_odd_row_bg" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> - The default background color for odd rows. - </theme_item> <theme_item name="table_vseparation" data_type="constant" type="int" default="3"> The vertical separation of elements in a table. </theme_item> + <theme_item name="bold_font" data_type="font" type="Font"> + The font used for bold text. + </theme_item> + <theme_item name="bold_italics_font" data_type="font" type="Font"> + The font used for bold italics text. + </theme_item> + <theme_item name="italics_font" data_type="font" type="Font"> + The font used for italics text. + </theme_item> + <theme_item name="mono_font" data_type="font" type="Font"> + The font used for monospace text. + </theme_item> + <theme_item name="normal_font" data_type="font" type="Font"> + The default text font. + </theme_item> + <theme_item name="bold_font_size" data_type="font_size" type="int"> + The font size used for bold text. + </theme_item> + <theme_item name="bold_italics_font_size" data_type="font_size" type="int"> + The font size used for bold italics text. + </theme_item> + <theme_item name="italics_font_size" data_type="font_size" type="int"> + The font size used for italics text. + </theme_item> + <theme_item name="mono_font_size" data_type="font_size" type="int"> + The font size used for monospace text. + </theme_item> + <theme_item name="normal_font_size" data_type="font_size" type="int"> + The default text font size. + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + The background The background used when the [RichTextLabel] is focused. + </theme_item> + <theme_item name="normal" data_type="style" type="StyleBox"> + The normal background for the [RichTextLabel]. + </theme_item> </theme_items> </class> diff --git a/doc/classes/TabBar.xml b/doc/classes/TabBar.xml index 612f8fb740..a9b09fb026 100644 --- a/doc/classes/TabBar.xml +++ b/doc/classes/TabBar.xml @@ -290,24 +290,6 @@ </constant> </constants> <theme_items> - <theme_item name="close" data_type="icon" type="Texture2D"> - The icon for the close button (see [member tab_close_display_policy]). - </theme_item> - <theme_item name="close_bg_highlight" data_type="style" type="StyleBox"> - Background of the close button when it's being hovered with the cursor. - </theme_item> - <theme_item name="close_bg_pressed" data_type="style" type="StyleBox"> - Background of the close button when it's being pressed. - </theme_item> - <theme_item name="decrement" data_type="icon" type="Texture2D"> - Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. - </theme_item> - <theme_item name="decrement_highlight" data_type="icon" type="Texture2D"> - Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - The font used to draw tab names. - </theme_item> <theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.9, 0.9, 0.9, 0.2)"> Font color of disabled tabs. </theme_item> @@ -317,23 +299,41 @@ <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Font color of the currently selected tab. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the tab names. - </theme_item> <theme_item name="font_unselected_color" data_type="color" type="Color" default="Color(0.69, 0.69, 0.69, 1)"> Font color of the other, unselected tabs. </theme_item> <theme_item name="hseparation" data_type="constant" type="int" default="4"> The horizontal separation between the elements inside tabs. </theme_item> + <theme_item name="outline_size" data_type="constant" type="int" default="0"> + The size of the tab text outline. + </theme_item> + <theme_item name="font" data_type="font" type="Font"> + The font used to draw tab names. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the tab names. + </theme_item> + <theme_item name="close" data_type="icon" type="Texture2D"> + The icon for the close button (see [member tab_close_display_policy]). + </theme_item> + <theme_item name="decrement" data_type="icon" type="Texture2D"> + Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. + </theme_item> + <theme_item name="decrement_highlight" data_type="icon" type="Texture2D"> + Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. + </theme_item> <theme_item name="increment" data_type="icon" type="Texture2D"> Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. </theme_item> <theme_item name="increment_highlight" data_type="icon" type="Texture2D"> Icon for the right arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. </theme_item> - <theme_item name="outline_size" data_type="constant" type="int" default="0"> - The size of the tab text outline. + <theme_item name="close_bg_highlight" data_type="style" type="StyleBox"> + Background of the close button when it's being hovered with the cursor. + </theme_item> + <theme_item name="close_bg_pressed" data_type="style" type="StyleBox"> + Background of the close button when it's being pressed. </theme_item> <theme_item name="tab_disabled" data_type="style" type="StyleBox"> The style of disabled tabs. diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index ad1e5c0050..2ac6549250 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -182,15 +182,6 @@ </constant> </constants> <theme_items> - <theme_item name="decrement" data_type="icon" type="Texture2D"> - Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. - </theme_item> - <theme_item name="decrement_highlight" data_type="icon" type="Texture2D"> - Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - The font used to draw tab names. - </theme_item> <theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.9, 0.9, 0.9, 0.2)"> Font color of disabled tabs. </theme_item> @@ -200,15 +191,30 @@ <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Font color of the currently selected tab. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the tab names. - </theme_item> <theme_item name="font_unselected_color" data_type="color" type="Color" default="Color(0.69, 0.69, 0.69, 1)"> Font color of the other, unselected tabs. </theme_item> <theme_item name="icon_separation" data_type="constant" type="int" default="4"> Space between tab's name and its icon. </theme_item> + <theme_item name="outline_size" data_type="constant" type="int" default="0"> + The size of the tab text outline. + </theme_item> + <theme_item name="side_margin" data_type="constant" type="int" default="8"> + The space at the left and right edges of the tab bar. + </theme_item> + <theme_item name="font" data_type="font" type="Font"> + The font used to draw tab names. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the tab names. + </theme_item> + <theme_item name="decrement" data_type="icon" type="Texture2D"> + Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. + </theme_item> + <theme_item name="decrement_highlight" data_type="icon" type="Texture2D"> + Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. + </theme_item> <theme_item name="increment" data_type="icon" type="Texture2D"> Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. </theme_item> @@ -221,15 +227,9 @@ <theme_item name="menu_highlight" data_type="icon" type="Texture2D"> The icon for the menu button (see [method set_popup]) when it's being hovered with the cursor. </theme_item> - <theme_item name="outline_size" data_type="constant" type="int" default="0"> - The size of the tab text outline. - </theme_item> <theme_item name="panel" data_type="style" type="StyleBox"> The style for the background fill. </theme_item> - <theme_item name="side_margin" data_type="constant" type="int" default="8"> - The space at the left and right edges of the tab bar. - </theme_item> <theme_item name="tab_disabled" data_type="style" type="StyleBox"> The style of disabled tabs. </theme_item> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index d14f8a9b35..0ed37bad34 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -1228,12 +1228,6 @@ <theme_item name="current_line_color" data_type="color" type="Color" default="Color(0.25, 0.25, 0.26, 0.8)"> Background [Color] of the line containing the caret. </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - Sets the [StyleBox] when in focus. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - Sets the default [Font]. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> Sets the font [Color]. </theme_item> @@ -1246,21 +1240,6 @@ <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Sets default font size. - </theme_item> - <theme_item name="line_spacing" data_type="constant" type="int" default="4"> - Sets the spacing between the lines. - </theme_item> - <theme_item name="normal" data_type="style" type="StyleBox"> - Sets the [StyleBox] of this [TextEdit]. - </theme_item> - <theme_item name="outline_size" data_type="constant" type="int" default="0"> - The size of the text outline. - </theme_item> - <theme_item name="read_only" data_type="style" type="StyleBox"> - Sets the [StyleBox] of this [TextEdit] when [member editable] is disabled. - </theme_item> <theme_item name="search_result_border_color" data_type="color" type="Color" default="Color(0.3, 0.3, 0.3, 0.4)"> [Color] of the border around text that matches the search query. </theme_item> @@ -1270,14 +1249,35 @@ <theme_item name="selection_color" data_type="color" type="Color" default="Color(0.49, 0.49, 0.49, 1)"> Sets the highlight [Color] of text selections. </theme_item> + <theme_item name="word_highlighted_color" data_type="color" type="Color" default="Color(0.8, 0.9, 0.9, 0.15)"> + Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled. + </theme_item> + <theme_item name="line_spacing" data_type="constant" type="int" default="4"> + Sets the spacing between the lines. + </theme_item> + <theme_item name="outline_size" data_type="constant" type="int" default="0"> + The size of the text outline. + </theme_item> + <theme_item name="font" data_type="font" type="Font"> + Sets the default [Font]. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Sets default font size. + </theme_item> <theme_item name="space" data_type="icon" type="Texture2D"> Sets a custom [Texture2D] for space text characters. </theme_item> <theme_item name="tab" data_type="icon" type="Texture2D"> Sets a custom [Texture2D] for tab text characters. </theme_item> - <theme_item name="word_highlighted_color" data_type="color" type="Color" default="Color(0.8, 0.9, 0.9, 0.15)"> - Sets the highlight [Color] of multiple occurrences. [member highlight_all_occurrences] has to be enabled. + <theme_item name="focus" data_type="style" type="StyleBox"> + Sets the [StyleBox] when in focus. + </theme_item> + <theme_item name="normal" data_type="style" type="StyleBox"> + Sets the [StyleBox] of this [TextEdit]. + </theme_item> + <theme_item name="read_only" data_type="style" type="StyleBox"> + Sets the [StyleBox] of this [TextEdit] when [member editable] is disabled. </theme_item> </theme_items> </class> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index ed24905254..e603d344ec 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -474,66 +474,15 @@ </constant> </constants> <theme_items> - <theme_item name="arrow" data_type="icon" type="Texture2D"> - The arrow icon used when a foldable item is not collapsed. - </theme_item> - <theme_item name="arrow_collapsed" data_type="icon" type="Texture2D"> - The arrow icon used when a foldable item is collapsed (for left-to-right layouts). - </theme_item> - <theme_item name="arrow_collapsed_mirrored" data_type="icon" type="Texture2D"> - The arrow icon used when a foldable item is collapsed (for right-to-left layouts). - </theme_item> - <theme_item name="bg" data_type="style" type="StyleBox"> - Default [StyleBox] for the [Tree], i.e. used when the control is not being focused. - </theme_item> - <theme_item name="bg_focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [Tree] is being focused. - </theme_item> - <theme_item name="button_margin" data_type="constant" type="int" default="4"> - The horizontal space between each button in a cell. - </theme_item> - <theme_item name="button_pressed" data_type="style" type="StyleBox"> - [StyleBox] used when a button in the tree is pressed. - </theme_item> - <theme_item name="checked" data_type="icon" type="Texture2D"> - The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is checked. - </theme_item> <theme_item name="children_hl_line_color" data_type="color" type="Color" default="Color(0.27, 0.27, 0.27, 1)"> The [Color] of the relationship lines between the selected [TreeItem] and its children. </theme_item> - <theme_item name="children_hl_line_width" data_type="constant" type="int" default="1"> - The width of the relationship lines between the selected [TreeItem] and its children. - </theme_item> - <theme_item name="cursor" data_type="style" type="StyleBox"> - [StyleBox] used for the cursor, when the [Tree] is being focused. - </theme_item> - <theme_item name="cursor_unfocused" data_type="style" type="StyleBox"> - [StyleBox] used for the cursor, when the [Tree] is not being focused. - </theme_item> - <theme_item name="custom_button" data_type="style" type="StyleBox"> - Default [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell. - </theme_item> <theme_item name="custom_button_font_highlight" data_type="color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> Text [Color] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered. </theme_item> - <theme_item name="custom_button_hover" data_type="style" type="StyleBox"> - [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered. - </theme_item> - <theme_item name="custom_button_pressed" data_type="style" type="StyleBox"> - [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's pressed. - </theme_item> - <theme_item name="draw_guides" data_type="constant" type="int" default="1"> - Draws the guidelines if not zero, this acts as a boolean. The guideline is a horizontal line drawn at the bottom of each item. - </theme_item> - <theme_item name="draw_relationship_lines" data_type="constant" type="int" default="0"> - Draws the relationship lines if not zero, this acts as a boolean. Relationship lines are drawn at the start of child items to show hierarchy. - </theme_item> <theme_item name="drop_position_color" data_type="color" type="Color" default="Color(1, 0.3, 0.2, 1)"> [Color] used to draw possible drop locations. See [enum DropModeFlags] constants for further description of drop locations. </theme_item> - <theme_item name="font" data_type="font" type="Font"> - [Font] of the item's text. - </theme_item> <theme_item name="font_color" data_type="color" type="Color" default="Color(0.69, 0.69, 0.69, 1)"> Default text [Color] of the item. </theme_item> @@ -543,36 +492,45 @@ <theme_item name="font_selected_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the item is selected. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the item's text. - </theme_item> <theme_item name="guide_color" data_type="color" type="Color" default="Color(0, 0, 0, 0.1)"> [Color] of the guideline. </theme_item> + <theme_item name="parent_hl_line_color" data_type="color" type="Color" default="Color(0.27, 0.27, 0.27, 1)"> + The [Color] of the relationship lines between the selected [TreeItem] and its parents. + </theme_item> + <theme_item name="relationship_line_color" data_type="color" type="Color" default="Color(0.27, 0.27, 0.27, 1)"> + The default [Color] of the relationship lines. + </theme_item> + <theme_item name="title_button_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> + Default text [Color] of the title button. + </theme_item> + <theme_item name="button_margin" data_type="constant" type="int" default="4"> + The horizontal space between each button in a cell. + </theme_item> + <theme_item name="children_hl_line_width" data_type="constant" type="int" default="1"> + The width of the relationship lines between the selected [TreeItem] and its children. + </theme_item> + <theme_item name="draw_guides" data_type="constant" type="int" default="1"> + Draws the guidelines if not zero, this acts as a boolean. The guideline is a horizontal line drawn at the bottom of each item. + </theme_item> + <theme_item name="draw_relationship_lines" data_type="constant" type="int" default="0"> + Draws the relationship lines if not zero, this acts as a boolean. Relationship lines are drawn at the start of child items to show hierarchy. + </theme_item> <theme_item name="hseparation" data_type="constant" type="int" default="4"> The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled. </theme_item> - <theme_item name="indeterminate" data_type="icon" type="Texture2D"> - The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is indeterminate. - </theme_item> <theme_item name="item_margin" data_type="constant" type="int" default="12"> The horizontal margin at the start of an item. This is used when folding is enabled for the item. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. </theme_item> - <theme_item name="parent_hl_line_color" data_type="color" type="Color" default="Color(0.27, 0.27, 0.27, 1)"> - The [Color] of the relationship lines between the selected [TreeItem] and its parents. - </theme_item> <theme_item name="parent_hl_line_margin" data_type="constant" type="int" default="0"> The space between the parent relationship lines for the selected [TreeItem] and the relationship lines to its siblings that are not selected. </theme_item> <theme_item name="parent_hl_line_width" data_type="constant" type="int" default="1"> The width of the relationship lines between the selected [TreeItem] and its parents. </theme_item> - <theme_item name="relationship_line_color" data_type="color" type="Color" default="Color(0.27, 0.27, 0.27, 1)"> - The default [Color] of the relationship lines. - </theme_item> <theme_item name="relationship_line_width" data_type="constant" type="int" default="1"> The default width of the relationship lines. </theme_item> @@ -582,21 +540,72 @@ <theme_item name="scroll_speed" data_type="constant" type="int" default="12"> The speed of border scrolling. </theme_item> + <theme_item name="vseparation" data_type="constant" type="int" default="4"> + The vertical padding inside each item, i.e. the distance between the item's content and top/bottom border. + </theme_item> + <theme_item name="font" data_type="font" type="Font"> + [Font] of the item's text. + </theme_item> + <theme_item name="title_button_font" data_type="font" type="Font"> + [Font] of the title button's text. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the item's text. + </theme_item> + <theme_item name="arrow" data_type="icon" type="Texture2D"> + The arrow icon used when a foldable item is not collapsed. + </theme_item> + <theme_item name="arrow_collapsed" data_type="icon" type="Texture2D"> + The arrow icon used when a foldable item is collapsed (for left-to-right layouts). + </theme_item> + <theme_item name="arrow_collapsed_mirrored" data_type="icon" type="Texture2D"> + The arrow icon used when a foldable item is collapsed (for right-to-left layouts). + </theme_item> + <theme_item name="checked" data_type="icon" type="Texture2D"> + The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is checked. + </theme_item> + <theme_item name="indeterminate" data_type="icon" type="Texture2D"> + The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is indeterminate. + </theme_item> <theme_item name="select_arrow" data_type="icon" type="Texture2D"> The arrow icon to display for the [constant TreeItem.CELL_MODE_RANGE] mode cell. </theme_item> + <theme_item name="unchecked" data_type="icon" type="Texture2D"> + The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is unchecked. + </theme_item> + <theme_item name="updown" data_type="icon" type="Texture2D"> + The updown arrow icon to display for the [constant TreeItem.CELL_MODE_RANGE] mode cell. + </theme_item> + <theme_item name="bg" data_type="style" type="StyleBox"> + Default [StyleBox] for the [Tree], i.e. used when the control is not being focused. + </theme_item> + <theme_item name="bg_focus" data_type="style" type="StyleBox"> + [StyleBox] used when the [Tree] is being focused. + </theme_item> + <theme_item name="button_pressed" data_type="style" type="StyleBox"> + [StyleBox] used when a button in the tree is pressed. + </theme_item> + <theme_item name="cursor" data_type="style" type="StyleBox"> + [StyleBox] used for the cursor, when the [Tree] is being focused. + </theme_item> + <theme_item name="cursor_unfocused" data_type="style" type="StyleBox"> + [StyleBox] used for the cursor, when the [Tree] is not being focused. + </theme_item> + <theme_item name="custom_button" data_type="style" type="StyleBox"> + Default [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell. + </theme_item> + <theme_item name="custom_button_hover" data_type="style" type="StyleBox"> + [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered. + </theme_item> + <theme_item name="custom_button_pressed" data_type="style" type="StyleBox"> + [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's pressed. + </theme_item> <theme_item name="selected" data_type="style" type="StyleBox"> [StyleBox] for the selected items, used when the [Tree] is not being focused. </theme_item> <theme_item name="selected_focus" data_type="style" type="StyleBox"> [StyleBox] for the selected items, used when the [Tree] is being focused. </theme_item> - <theme_item name="title_button_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> - Default text [Color] of the title button. - </theme_item> - <theme_item name="title_button_font" data_type="font" type="Font"> - [Font] of the title button's text. - </theme_item> <theme_item name="title_button_hover" data_type="style" type="StyleBox"> [StyleBox] used when the title button is being hovered. </theme_item> @@ -606,14 +615,5 @@ <theme_item name="title_button_pressed" data_type="style" type="StyleBox"> [StyleBox] used when the title button is being pressed. </theme_item> - <theme_item name="unchecked" data_type="icon" type="Texture2D"> - The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is unchecked. - </theme_item> - <theme_item name="updown" data_type="icon" type="Texture2D"> - The updown arrow icon to display for the [constant TreeItem.CELL_MODE_RANGE] mode cell. - </theme_item> - <theme_item name="vseparation" data_type="constant" type="int" default="4"> - The vertical padding inside each item, i.e. the distance between the item's content and top/bottom border. - </theme_item> </theme_items> </class> diff --git a/doc/classes/VScrollBar.xml b/doc/classes/VScrollBar.xml index 0cf06576f6..ce78b83c20 100644 --- a/doc/classes/VScrollBar.xml +++ b/doc/classes/VScrollBar.xml @@ -22,15 +22,6 @@ <theme_item name="decrement_pressed" data_type="icon" type="Texture2D"> Displayed when the decrement button is being pressed. </theme_item> - <theme_item name="grabber" data_type="style" type="StyleBox"> - Used as texture for the grabber, the draggable element representing current scroll. - </theme_item> - <theme_item name="grabber_highlight" data_type="style" type="StyleBox"> - Used when the mouse hovers over the grabber. - </theme_item> - <theme_item name="grabber_pressed" data_type="style" type="StyleBox"> - Used when the grabber is being dragged. - </theme_item> <theme_item name="increment" data_type="icon" type="Texture2D"> Icon used as a button to scroll the [ScrollBar] down. Supports custom step using the [member ScrollBar.custom_step] property. </theme_item> @@ -40,6 +31,15 @@ <theme_item name="increment_pressed" data_type="icon" type="Texture2D"> Displayed when the increment button is being pressed. </theme_item> + <theme_item name="grabber" data_type="style" type="StyleBox"> + Used as texture for the grabber, the draggable element representing current scroll. + </theme_item> + <theme_item name="grabber_highlight" data_type="style" type="StyleBox"> + Used when the mouse hovers over the grabber. + </theme_item> + <theme_item name="grabber_pressed" data_type="style" type="StyleBox"> + Used when the grabber is being dragged. + </theme_item> <theme_item name="scroll" data_type="style" type="StyleBox"> Used as background of this [ScrollBar]. </theme_item> diff --git a/doc/classes/VSlider.xml b/doc/classes/VSlider.xml index 286674a9b4..aa43fac347 100644 --- a/doc/classes/VSlider.xml +++ b/doc/classes/VSlider.xml @@ -17,22 +17,22 @@ <theme_item name="grabber" data_type="icon" type="Texture2D"> The texture for the grabber (the draggable element). </theme_item> - <theme_item name="grabber_area" data_type="style" type="StyleBox"> - The background of the area below the grabber. - </theme_item> - <theme_item name="grabber_area_highlight" data_type="style" type="StyleBox"> - </theme_item> <theme_item name="grabber_disabled" data_type="icon" type="Texture2D"> The texture for the grabber when it's disabled. </theme_item> <theme_item name="grabber_highlight" data_type="icon" type="Texture2D"> The texture for the grabber when it's focused. </theme_item> - <theme_item name="slider" data_type="style" type="StyleBox"> - The background for the whole slider. Determines the width of the [code]grabber_area[/code]. - </theme_item> <theme_item name="tick" data_type="icon" type="Texture2D"> The texture for the ticks, visible when [member Slider.tick_count] is greater than 0. </theme_item> + <theme_item name="grabber_area" data_type="style" type="StyleBox"> + The background of the area below the grabber. + </theme_item> + <theme_item name="grabber_area_highlight" data_type="style" type="StyleBox"> + </theme_item> + <theme_item name="slider" data_type="style" type="StyleBox"> + The background for the whole slider. Determines the width of the [code]grabber_area[/code]. + </theme_item> </theme_items> </class> diff --git a/doc/classes/VSplitContainer.xml b/doc/classes/VSplitContainer.xml index 323ce1fe80..6316068e9d 100644 --- a/doc/classes/VSplitContainer.xml +++ b/doc/classes/VSplitContainer.xml @@ -12,13 +12,13 @@ <theme_item name="autohide" data_type="constant" type="int" default="1"> Boolean value. If 1 ([code]true[/code]), the grabber will hide automatically when it isn't under the cursor. If 0 ([code]false[/code]), it's always visible. </theme_item> - <theme_item name="bg" data_type="style" type="StyleBox"> + <theme_item name="separation" data_type="constant" type="int" default="12"> + The space between sides of the container. </theme_item> <theme_item name="grabber" data_type="icon" type="Texture2D"> The icon used for the grabber drawn in the middle area. </theme_item> - <theme_item name="separation" data_type="constant" type="int" default="12"> - The space between sides of the container. + <theme_item name="bg" data_type="style" type="StyleBox"> </theme_item> </theme_items> </class> diff --git a/doc/classes/VisualShaderNodeIntFunc.xml b/doc/classes/VisualShaderNodeIntFunc.xml index d2782efa96..316529a347 100644 --- a/doc/classes/VisualShaderNodeIntFunc.xml +++ b/doc/classes/VisualShaderNodeIntFunc.xml @@ -23,7 +23,10 @@ <constant name="FUNC_SIGN" value="2" enum="Function"> Extracts the sign of the parameter. Translates to [code]sign(x)[/code] in the Godot Shader Language. </constant> - <constant name="FUNC_MAX" value="3" enum="Function"> + <constant name="FUNC_BITWISE_NOT" value="3" enum="Function"> + Returns the result of bitwise [code]NOT[/code] operation on the integer. Translates to [code]~a[/code] in the Godot Shader Language. + </constant> + <constant name="FUNC_MAX" value="4" enum="Function"> Represents the size of the [enum Function] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeIntOp.xml b/doc/classes/VisualShaderNodeIntOp.xml index e5fcafca81..c685592fd0 100644 --- a/doc/classes/VisualShaderNodeIntOp.xml +++ b/doc/classes/VisualShaderNodeIntOp.xml @@ -35,7 +35,22 @@ <constant name="OP_MIN" value="6" enum="Operator"> Returns the lesser of two numbers. Translates to [code]max(a, b)[/code] in the Godot Shader Language. </constant> - <constant name="OP_ENUM_SIZE" value="7" enum="Operator"> + <constant name="OP_BITWISE_AND" value="7" enum="Operator"> + Returns the result of bitwise [code]AND[/code] operation on the integer. Translates to [code]a & b[/code] in the Godot Shader Language. + </constant> + <constant name="OP_BITWISE_OR" value="8" enum="Operator"> + Returns the result of bitwise [code]OR[/code] operation for two integers. Translates to [code]a | b[/code] in the Godot Shader Language. + </constant> + <constant name="OP_BITWISE_XOR" value="9" enum="Operator"> + Returns the result of bitwise [code]XOR[/code] operation for two integers. Translates to [code]a ^ b[/code] in the Godot Shader Language. + </constant> + <constant name="OP_BITWISE_LEFT_SHIFT" value="10" enum="Operator"> + Returns the result of bitwise left shift operation on the integer. Translates to [code]a << b[/code] in the Godot Shader Language. + </constant> + <constant name="OP_BITWISE_RIGHT_SHIFT" value="11" enum="Operator"> + Returns the result of bitwise right shift operation on the integer. Translates to [code]a >> b[/code] in the Godot Shader Language. + </constant> + <constant name="OP_ENUM_SIZE" value="12" enum="Operator"> Represents the size of the [enum Operator] enum. </constant> </constants> diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 3fee1feae8..c7ca6a20be 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -437,34 +437,34 @@ </constant> </constants> <theme_items> - <theme_item name="close" data_type="icon" type="Texture2D"> + <theme_item name="title_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> </theme_item> - <theme_item name="close_h_ofs" data_type="constant" type="int" default="18"> + <theme_item name="title_outline_modulate" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> + The color of the title outline. </theme_item> - <theme_item name="close_pressed" data_type="icon" type="Texture2D"> + <theme_item name="close_h_ofs" data_type="constant" type="int" default="18"> </theme_item> <theme_item name="close_v_ofs" data_type="constant" type="int" default="18"> </theme_item> - <theme_item name="embedded_border" data_type="style" type="StyleBox"> - </theme_item> <theme_item name="resize_margin" data_type="constant" type="int" default="4"> </theme_item> <theme_item name="scaleborder_size" data_type="constant" type="int" default="4"> </theme_item> - <theme_item name="title_color" data_type="color" type="Color" default="Color(0, 0, 0, 1)"> + <theme_item name="title_height" data_type="constant" type="int" default="20"> + </theme_item> + <theme_item name="title_outline_size" data_type="constant" type="int" default="0"> + The size of the title outline. </theme_item> <theme_item name="title_font" data_type="font" type="Font"> </theme_item> <theme_item name="title_font_size" data_type="font_size" type="int"> The size of the title font. </theme_item> - <theme_item name="title_height" data_type="constant" type="int" default="20"> + <theme_item name="close" data_type="icon" type="Texture2D"> </theme_item> - <theme_item name="title_outline_modulate" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> - The color of the title outline. + <theme_item name="close_pressed" data_type="icon" type="Texture2D"> </theme_item> - <theme_item name="title_outline_size" data_type="constant" type="int" default="0"> - The size of the title outline. + <theme_item name="embedded_border" data_type="style" type="StyleBox"> </theme_item> </theme_items> </class> diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp index 5ce57e936a..f2b08a574f 100644 --- a/editor/doc_tools.cpp +++ b/editor/doc_tools.cpp @@ -603,6 +603,8 @@ void DocTools::generate(bool p_basic_types) { tid.data_type = "style"; c.theme_properties.push_back(tid); } + + c.theme_properties.sort(); } classes.pop_front(); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index f520877256..4082dcefbc 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -237,8 +237,7 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview class_desc->push_cell(); class_desc->push_paragraph(RichTextLabel::ALIGN_RIGHT, Control::TEXT_DIRECTION_AUTO, ""); } else { - static const char32_t prefix[3] = { 0x25CF /* filled circle */, ' ', 0 }; - class_desc->add_text(String(prefix)); + _add_bulletpoint(); } _add_type(p_method.return_type, p_method.return_enum); @@ -314,6 +313,11 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview } } +void EditorHelp::_add_bulletpoint() { + static const char32_t prefix[3] = { 0x25CF /* filled circle */, ' ', 0 }; + class_desc->add_text(String(prefix)); +} + Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) { if (!doc->class_list.has(p_class)) { return ERR_DOES_NOT_EXIST; @@ -837,27 +841,54 @@ void EditorHelp::_update_doc() { class_desc->pop(); class_desc->pop(); + class_desc->add_newline(); + class_desc->add_newline(); + class_desc->push_indent(1); - class_desc->push_table(2); - class_desc->set_table_column_expand(1, true); + + String theme_data_type; + Map<String, String> data_type_names; + data_type_names["color"] = TTR("Colors"); + data_type_names["constant"] = TTR("Constants"); + data_type_names["font"] = TTR("Fonts"); + data_type_names["font_size"] = TTR("Font Sizes"); + data_type_names["icon"] = TTR("Icons"); + data_type_names["style"] = TTR("Styles"); for (int i = 0; i < cd.theme_properties.size(); i++) { theme_property_line[cd.theme_properties[i].name] = class_desc->get_line_count() - 2; //gets overridden if description - class_desc->push_cell(); - class_desc->push_paragraph(RichTextLabel::ALIGN_RIGHT, Control::TEXT_DIRECTION_AUTO, ""); + if (theme_data_type != cd.theme_properties[i].data_type) { + theme_data_type = cd.theme_properties[i].data_type; + + class_desc->push_color(title_color); + class_desc->push_font(doc_title_font); + if (data_type_names.has(theme_data_type)) { + class_desc->add_text(data_type_names[theme_data_type]); + } else { + class_desc->add_text(""); + } + class_desc->pop(); + class_desc->pop(); + + class_desc->add_newline(); + class_desc->add_newline(); + } + + // Theme item header. class_desc->push_font(doc_code_font); + _add_bulletpoint(); + + // Theme item object type. _add_type(cd.theme_properties[i].type); - class_desc->pop(); - class_desc->pop(); - class_desc->pop(); - class_desc->push_cell(); - class_desc->push_font(doc_code_font); + // Theme item name. class_desc->push_color(headline_color); + class_desc->add_text(" "); _add_text(cd.theme_properties[i].name); class_desc->pop(); + // Theme item default value. if (cd.theme_properties[i].default_value != "") { class_desc->push_color(symbol_color); class_desc->add_text(" [" + TTR("default:") + " "); @@ -870,23 +901,25 @@ void EditorHelp::_update_doc() { class_desc->pop(); } - class_desc->pop(); + class_desc->pop(); // monofont + // Theme item description. if (cd.theme_properties[i].description != "") { class_desc->push_font(doc_font); class_desc->push_color(comment_color); - class_desc->add_text(U" – "); + class_desc->push_indent(1); _add_text(DTR(cd.theme_properties[i].description)); - class_desc->pop(); - class_desc->pop(); + class_desc->pop(); // indent + class_desc->pop(); // color + class_desc->pop(); // font } - class_desc->pop(); // cell + + class_desc->add_newline(); + class_desc->add_newline(); } - class_desc->pop(); // table class_desc->pop(); class_desc->add_newline(); - class_desc->add_newline(); } // Signals @@ -909,10 +942,10 @@ void EditorHelp::_update_doc() { for (int i = 0; i < cd.signals.size(); i++) { signal_line[cd.signals[i].name] = class_desc->get_line_count() - 2; //gets overridden if description + class_desc->push_font(doc_code_font); // monofont class_desc->push_color(headline_color); - static const char32_t prefix[3] = { 0x25CF /* filled circle */, ' ', 0 }; - class_desc->add_text(String(prefix)); + _add_bulletpoint(); _add_text(cd.signals[i].name); class_desc->pop(); class_desc->push_color(symbol_color); @@ -1043,8 +1076,7 @@ void EditorHelp::_update_doc() { class_desc->push_font(doc_code_font); class_desc->push_color(headline_color); - static const char32_t prefix[3] = { 0x25CF /* filled circle */, ' ', 0 }; - class_desc->add_text(String(prefix)); + _add_bulletpoint(); _add_text(enum_list[i].name); class_desc->pop(); class_desc->push_color(symbol_color); @@ -1054,10 +1086,12 @@ void EditorHelp::_update_doc() { _add_text(_fix_constant(enum_list[i].value)); class_desc->pop(); class_desc->pop(); - if (enum_list[i].description != "") { + + class_desc->add_newline(); + + if (enum_list[i].description.strip_edges() != "") { class_desc->push_font(doc_font); class_desc->push_color(comment_color); - class_desc->add_text(U" – "); _add_text(DTR(enum_list[i].description)); class_desc->pop(); class_desc->pop(); @@ -1103,13 +1137,11 @@ void EditorHelp::_update_doc() { Vector<float> color = stripped.split_floats(","); if (color.size() >= 3) { class_desc->push_color(Color(color[0], color[1], color[2])); - static const char32_t prefix[3] = { 0x25CF /* filled circle */, ' ', 0 }; - class_desc->add_text(String(prefix)); + _add_bulletpoint(); class_desc->pop(); } } else { - static const char32_t prefix[3] = { 0x25CF /* filled circle */, ' ', 0 }; - class_desc->add_text(String(prefix)); + _add_bulletpoint(); } class_desc->push_color(headline_color); @@ -1123,10 +1155,12 @@ void EditorHelp::_update_doc() { class_desc->pop(); class_desc->pop(); + + class_desc->add_newline(); + if (constants[i].description != "") { class_desc->push_font(doc_font); class_desc->push_color(comment_color); - class_desc->add_text(U" – "); _add_text(DTR(constants[i].description)); class_desc->pop(); class_desc->pop(); @@ -1167,8 +1201,7 @@ void EditorHelp::_update_doc() { class_desc->push_cell(); class_desc->push_font(doc_code_font); - static const char32_t prefix[3] = { 0x25CF /* filled circle */, ' ', 0 }; - class_desc->add_text(String(prefix)); + _add_bulletpoint(); _add_type(cd.properties[i].type, cd.properties[i].enumeration); class_desc->add_text(" "); diff --git a/editor/editor_help.h b/editor/editor_help.h index c0f3f66505..393e4a940a 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -145,6 +145,8 @@ class EditorHelp : public VBoxContainer { void _add_type(const String &p_type, const String &p_enum = String()); void _add_method(const DocData::MethodDoc &p_method, bool p_overview = true); + void _add_bulletpoint(); + void _class_list_select(const String &p_select); void _class_desc_select(const String &p_select); void _class_desc_input(const Ref<InputEvent> &p_input); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index d9ce7cfd94..aa46eef21f 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2913,14 +2913,6 @@ void CanvasItemEditor::_draw_ruler_tool() { Point2 corner = Point2(begin.x, end.y); Vector2 length_vector = (begin - end).abs() / zoom; - bool draw_secondary_lines = !(Math::is_equal_approx(begin.y, corner.y) || Math::is_equal_approx(end.x, corner.x)); - - viewport->draw_line(begin, end, ruler_primary_color, Math::round(EDSCALE * 3)); - if (draw_secondary_lines) { - viewport->draw_line(begin, corner, ruler_secondary_color, Math::round(EDSCALE)); - viewport->draw_line(corner, end, ruler_secondary_color, Math::round(EDSCALE)); - } - Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts")); int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts")); Color font_color = get_theme_color(SNAME("font_color"), SNAME("Editor")); @@ -2936,8 +2928,24 @@ void CanvasItemEditor::_draw_ruler_tool() { Point2 text_pos = (begin + end) / 2 - Vector2(text_width / 2, text_height / 2); text_pos.x = CLAMP(text_pos.x, text_width / 2, viewport->get_rect().size.x - text_width * 1.5); text_pos.y = CLAMP(text_pos.y, text_height * 1.5, viewport->get_rect().size.y - text_height * 1.5); + + if (begin.is_equal_approx(end)) { + viewport->draw_string(font, text_pos, (String)ruler_tool_origin, HALIGN_LEFT, -1, font_size, font_color, outline_size, outline_color); + Ref<Texture2D> position_icon = get_theme_icon(SNAME("EditorPosition"), SNAME("EditorIcons")); + viewport->draw_texture(get_theme_icon(SNAME("EditorPosition"), SNAME("EditorIcons")), (ruler_tool_origin - view_offset) * zoom - position_icon->get_size() / 2); + return; + } + viewport->draw_string(font, text_pos, TS->format_number(vformat("%.1f px", length_vector.length())), HALIGN_LEFT, -1, font_size, font_color, outline_size, outline_color); + bool draw_secondary_lines = !(Math::is_equal_approx(begin.y, corner.y) || Math::is_equal_approx(end.x, corner.x)); + + viewport->draw_line(begin, end, ruler_primary_color, Math::round(EDSCALE * 3)); + if (draw_secondary_lines) { + viewport->draw_line(begin, corner, ruler_secondary_color, Math::round(EDSCALE)); + viewport->draw_line(corner, end, ruler_secondary_color, Math::round(EDSCALE)); + } + if (draw_secondary_lines) { const real_t horizontal_angle_rad = length_vector.angle(); const real_t vertical_angle_rad = Math_PI / 2.0 - horizontal_angle_rad; diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp index 154f9bd6b7..60ba98a706 100644 --- a/editor/plugins/node_3d_editor_gizmos.cpp +++ b/editor/plugins/node_3d_editor_gizmos.cpp @@ -244,8 +244,10 @@ void EditorNode3DGizmo::Instance::create_instance(Node3D *p_base, bool p_hidden) RS::get_singleton()->instance_geometry_set_flag(instance, RS::INSTANCE_FLAG_IGNORE_OCCLUSION_CULLING, true); } -void EditorNode3DGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, const Ref<Material> &p_material, const Transform3D &p_xform, const Ref<SkinReference> &p_skin_reference) { +void EditorNode3DGizmo::add_mesh(const Ref<Mesh> &p_mesh, const Ref<Material> &p_material, const Transform3D &p_xform, const Ref<SkinReference> &p_skin_reference) { ERR_FAIL_COND(!spatial_node); + ERR_FAIL_COND_MSG(!p_mesh.is_valid(), "EditorNode3DGizmo.add_mesh() requires a valid Mesh resource."); + Instance ins; ins.mesh = p_mesh; diff --git a/editor/plugins/node_3d_editor_gizmos.h b/editor/plugins/node_3d_editor_gizmos.h index 56e4ad5518..cf9a464b69 100644 --- a/editor/plugins/node_3d_editor_gizmos.h +++ b/editor/plugins/node_3d_editor_gizmos.h @@ -45,7 +45,7 @@ class EditorNode3DGizmo : public Node3DGizmo { struct Instance { RID instance; - Ref<ArrayMesh> mesh; + Ref<Mesh> mesh; Ref<Material> material; Ref<SkinReference> skin_reference; bool extra_margin = false; @@ -95,7 +95,7 @@ protected: public: void add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard = false, const Color &p_modulate = Color(1, 1, 1)); void add_vertices(const Vector<Vector3> &p_vertices, const Ref<Material> &p_material, Mesh::PrimitiveType p_primitive_type, bool p_billboard = false, const Color &p_modulate = Color(1, 1, 1)); - void add_mesh(const Ref<ArrayMesh> &p_mesh, const Ref<Material> &p_material = Ref<Material>(), const Transform3D &p_xform = Transform3D(), const Ref<SkinReference> &p_skin_reference = Ref<SkinReference>()); + void add_mesh(const Ref<Mesh> &p_mesh, const Ref<Material> &p_material = Ref<Material>(), const Transform3D &p_xform = Transform3D(), const Ref<SkinReference> &p_skin_reference = Ref<SkinReference>()); void add_collision_segments(const Vector<Vector3> &p_lines); void add_collision_triangles(const Ref<TriangleMesh> &p_tmesh); void add_unscaled_billboard(const Ref<Material> &p_material, real_t p_scale = 1, const Color &p_modulate = Color(1, 1, 1)); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index da73fc093c..44f2eaa2a1 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -4556,6 +4556,7 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("ATan", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the arc-tangent of the parameter."), VisualShaderNodeFloatFunc::FUNC_ATAN, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("ATan2", "Scalar", "Functions", "VisualShaderNodeFloatOp", TTR("Returns the arc-tangent of the parameters."), VisualShaderNodeFloatOp::OP_ATAN2, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("ATanH", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Returns the inverse hyperbolic tangent of the parameter."), VisualShaderNodeFloatFunc::FUNC_ATANH, VisualShaderNode::PORT_TYPE_SCALAR)); + add_options.push_back(AddOption("BitwiseNOT", "Scalar", "Functions", "VisualShaderNodeIntFunc", TTR("Returns the result of bitwise NOT (~a) operation on the integer."), VisualShaderNodeIntFunc::FUNC_BITWISE_NOT, VisualShaderNode::PORT_TYPE_SCALAR_INT)); add_options.push_back(AddOption("Ceil", "Scalar", "Functions", "VisualShaderNodeFloatFunc", TTR("Finds the nearest integer that is greater than or equal to the parameter."), VisualShaderNodeFloatFunc::FUNC_CEIL, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Clamp", "Scalar", "Functions", "VisualShaderNodeClamp", TTR("Constrains a value to lie between two further values."), VisualShaderNodeClamp::OP_TYPE_FLOAT, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Clamp", "Scalar", "Functions", "VisualShaderNodeClamp", TTR("Constrains a value to lie between two further values."), VisualShaderNodeClamp::OP_TYPE_INT, VisualShaderNode::PORT_TYPE_SCALAR_INT)); @@ -4595,6 +4596,11 @@ VisualShaderEditor::VisualShaderEditor() { add_options.push_back(AddOption("Add", "Scalar", "Operators", "VisualShaderNodeFloatOp", TTR("Sums two floating-point scalars."), VisualShaderNodeFloatOp::OP_ADD, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Add", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Sums two integer scalars."), VisualShaderNodeIntOp::OP_ADD, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("BitwiseAND", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Returns the result of bitwise AND (a & b) operation for two integers."), VisualShaderNodeIntOp::OP_BITWISE_AND, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("BitwiseLeftShift", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Returns the result of bitwise left shift (a << b) operation on the integer."), VisualShaderNodeIntOp::OP_BITWISE_LEFT_SHIFT, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("BitwiseOR", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Returns the result of bitwise OR (a | b) operation for two integers."), VisualShaderNodeIntOp::OP_BITWISE_OR, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("BitwiseRightShift", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Returns the result of bitwise right shift (a >> b) operation on the integer."), VisualShaderNodeIntOp::OP_BITWISE_RIGHT_SHIFT, VisualShaderNode::PORT_TYPE_SCALAR_INT)); + add_options.push_back(AddOption("BitwiseXOR", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Returns the result of bitwise XOR (a ^ b) operation on the integer."), VisualShaderNodeIntOp::OP_BITWISE_XOR, VisualShaderNode::PORT_TYPE_SCALAR_INT)); add_options.push_back(AddOption("Divide", "Scalar", "Operators", "VisualShaderNodeFloatOp", TTR("Divides two floating-point scalars."), VisualShaderNodeFloatOp::OP_DIV, VisualShaderNode::PORT_TYPE_SCALAR)); add_options.push_back(AddOption("Divide", "Scalar", "Operators", "VisualShaderNodeIntOp", TTR("Divides two integer scalars."), VisualShaderNodeIntOp::OP_DIV, VisualShaderNode::PORT_TYPE_SCALAR_INT)); add_options.push_back(AddOption("Multiply", "Scalar", "Operators", "VisualShaderNodeFloatOp", TTR("Multiplies two floating-point scalars."), VisualShaderNodeFloatOp::OP_MUL, VisualShaderNode::PORT_TYPE_SCALAR)); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 3ac1a0eaf0..007e5d1173 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1869,14 +1869,12 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { Transform2D localizer = gui.drag_mouse_over->get_global_transform_with_canvas().affine_inverse(); gui.drag_mouse_over_pos = localizer.xform(viewport_pos); - if ((mm->get_button_mask() & MouseButton::MASK_LEFT) != MouseButton::NONE) { - bool can_drop = _gui_drop(gui.drag_mouse_over, gui.drag_mouse_over_pos, true); + bool can_drop = _gui_drop(gui.drag_mouse_over, gui.drag_mouse_over_pos, true); - if (!can_drop) { - ds_cursor_shape = DisplayServer::CURSOR_FORBIDDEN; - } else { - ds_cursor_shape = DisplayServer::CURSOR_CAN_DROP; - } + if (!can_drop) { + ds_cursor_shape = DisplayServer::CURSOR_FORBIDDEN; + } else { + ds_cursor_shape = DisplayServer::CURSOR_CAN_DROP; } } @@ -2044,6 +2042,7 @@ void Viewport::_gui_force_drag(Control *p_base, const Variant &p_data, Control * if (p_control) { _gui_set_drag_preview(p_base, p_control); } + _propagate_viewport_notification(this, NOTIFICATION_DRAG_BEGIN); } void Viewport::_gui_set_drag_preview(Control *p_base, Control *p_control) { diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp index 951870fe34..e6870971d4 100644 --- a/scene/resources/visual_shader_nodes.cpp +++ b/scene/resources/visual_shader_nodes.cpp @@ -1647,6 +1647,21 @@ String VisualShaderNodeIntOp::generate_code(Shader::Mode p_mode, VisualShader::T case OP_MIN: code += "min(" + p_input_vars[0] + ", " + p_input_vars[1] + ");\n"; break; + case OP_BITWISE_AND: + code += p_input_vars[0] + " & " + p_input_vars[1] + ";\n"; + break; + case OP_BITWISE_OR: + code += p_input_vars[0] + " | " + p_input_vars[1] + ";\n"; + break; + case OP_BITWISE_XOR: + code += p_input_vars[0] + " ^ " + p_input_vars[1] + ";\n"; + break; + case OP_BITWISE_LEFT_SHIFT: + code += p_input_vars[0] + " << " + p_input_vars[1] + ";\n"; + break; + case OP_BITWISE_RIGHT_SHIFT: + code += p_input_vars[0] + " >> " + p_input_vars[1] + ";\n"; + break; default: break; } @@ -1677,7 +1692,7 @@ void VisualShaderNodeIntOp::_bind_methods() { ClassDB::bind_method(D_METHOD("set_operator", "op"), &VisualShaderNodeIntOp::set_operator); ClassDB::bind_method(D_METHOD("get_operator"), &VisualShaderNodeIntOp::get_operator); - ADD_PROPERTY(PropertyInfo(Variant::INT, "operator", PROPERTY_HINT_ENUM, "Add,Subtract,Multiply,Divide,Remainder,Max,Min"), "set_operator", "get_operator"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "operator", PROPERTY_HINT_ENUM, "Add,Subtract,Multiply,Divide,Remainder,Max,Min,Bitwise AND,Bitwise OR,Bitwise XOR,Bitwise Left Shift,Bitwise Right Shift"), "set_operator", "get_operator"); BIND_ENUM_CONSTANT(OP_ADD); BIND_ENUM_CONSTANT(OP_SUB); @@ -1686,6 +1701,11 @@ void VisualShaderNodeIntOp::_bind_methods() { BIND_ENUM_CONSTANT(OP_MOD); BIND_ENUM_CONSTANT(OP_MAX); BIND_ENUM_CONSTANT(OP_MIN); + BIND_ENUM_CONSTANT(OP_BITWISE_AND); + BIND_ENUM_CONSTANT(OP_BITWISE_OR); + BIND_ENUM_CONSTANT(OP_BITWISE_XOR); + BIND_ENUM_CONSTANT(OP_BITWISE_LEFT_SHIFT); + BIND_ENUM_CONSTANT(OP_BITWISE_RIGHT_SHIFT); BIND_ENUM_CONSTANT(OP_ENUM_SIZE); } @@ -2333,7 +2353,8 @@ String VisualShaderNodeIntFunc::generate_code(Shader::Mode p_mode, VisualShader: static const char *functions[FUNC_MAX] = { "abs($)", "-($)", - "sign($)" + "sign($)", + "~($)" }; return " " + p_output_vars[0] + " = " + String(functions[func]).replace("$", p_input_vars[0]) + ";\n"; @@ -2362,11 +2383,12 @@ void VisualShaderNodeIntFunc::_bind_methods() { ClassDB::bind_method(D_METHOD("set_function", "func"), &VisualShaderNodeIntFunc::set_function); ClassDB::bind_method(D_METHOD("get_function"), &VisualShaderNodeIntFunc::get_function); - ADD_PROPERTY(PropertyInfo(Variant::INT, "function", PROPERTY_HINT_ENUM, "Abs,Negate,Sign"), "set_function", "get_function"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "function", PROPERTY_HINT_ENUM, "Abs,Negate,Sign,Bitwise NOT"), "set_function", "get_function"); BIND_ENUM_CONSTANT(FUNC_ABS); BIND_ENUM_CONSTANT(FUNC_NEGATE); BIND_ENUM_CONSTANT(FUNC_SIGN); + BIND_ENUM_CONSTANT(FUNC_BITWISE_NOT); BIND_ENUM_CONSTANT(FUNC_MAX); } diff --git a/scene/resources/visual_shader_nodes.h b/scene/resources/visual_shader_nodes.h index 2c952300fe..2f3400404c 100644 --- a/scene/resources/visual_shader_nodes.h +++ b/scene/resources/visual_shader_nodes.h @@ -579,6 +579,11 @@ public: OP_MOD, OP_MAX, OP_MIN, + OP_BITWISE_AND, + OP_BITWISE_OR, + OP_BITWISE_XOR, + OP_BITWISE_LEFT_SHIFT, + OP_BITWISE_RIGHT_SHIFT, OP_ENUM_SIZE, }; @@ -882,6 +887,7 @@ public: FUNC_ABS, FUNC_NEGATE, FUNC_SIGN, + FUNC_BITWISE_NOT, FUNC_MAX, }; diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 052b1d6d9f..f5e91d0423 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -88,7 +88,8 @@ String ShaderLanguage::get_operator_text(Operator p_op) { "--", "()", "construct", - "index" }; + "index", + "empty" }; return op_names[p_op]; } @@ -474,6 +475,10 @@ ShaderLanguage::Token ShaderLanguage::_get_token() { case ':': return _make_token(TK_COLON); case '^': + if (GETCHAR(0) == '=') { + char_idx++; + return _make_token(TK_OP_ASSIGN_BIT_XOR); + } return _make_token(TK_OP_BIT_XOR); case '~': return _make_token(TK_OP_BIT_INVERT); |