diff options
-rw-r--r-- | doc/classes/BaseButton.xml | 3 | ||||
-rw-r--r-- | doc/classes/KinematicBody2D.xml | 6 | ||||
-rw-r--r-- | doc/classes/KinematicBody3D.xml | 6 | ||||
-rw-r--r-- | doc/classes/LinkButton.xml | 1 | ||||
-rw-r--r-- | doc/classes/MenuButton.xml | 1 | ||||
-rw-r--r-- | doc/classes/ProjectSettings.xml | 2 | ||||
-rw-r--r-- | editor/editor_run_native.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 25 | ||||
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.h | 1 | ||||
-rw-r--r-- | modules/bullet/rigid_body_bullet.cpp | 1 | ||||
-rw-r--r-- | modules/mono/csharp_script.cpp | 190 | ||||
-rw-r--r-- | modules/mono/csharp_script.h | 1 | ||||
-rw-r--r-- | modules/visual_script/visual_script_func_nodes.cpp | 1 | ||||
-rw-r--r-- | scene/gui/base_button.cpp | 15 | ||||
-rw-r--r-- | scene/gui/base_button.h | 4 | ||||
-rw-r--r-- | scene/gui/link_button.cpp | 1 | ||||
-rw-r--r-- | scene/gui/menu_button.cpp | 1 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 3 |
18 files changed, 117 insertions, 151 deletions
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml index bf4d9383ac..e3045f9611 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -51,9 +51,6 @@ <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false"> If [code]true[/code], the button is in disabled state and can't be clicked or toggled. </member> - <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" enum="Control.FocusMode" default="2"> - Focus access mode to use when switching between enabled/disabled (see [member Control.focus_mode] and [member disabled]). - </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" /> <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group"> [ButtonGroup] associated to the button. diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index 17c4b85346..425df00b6f 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -55,21 +55,21 @@ <return type="bool"> </return> <description> - Returns [code]true[/code] if the body is on the ceiling. Only updates when calling [method move_and_slide] or [method move_and_slide_with_snap]. + Returns [code]true[/code] if the body collided with the ceiling on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code]. </description> </method> <method name="is_on_floor" qualifiers="const"> <return type="bool"> </return> <description> - Returns [code]true[/code] if the body is on the floor. Only updates when calling [method move_and_slide] or [method move_and_slide_with_snap]. + Returns [code]true[/code] if the body collided with the floor on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code]. </description> </method> <method name="is_on_wall" qualifiers="const"> <return type="bool"> </return> <description> - Returns [code]true[/code] if the body is on a wall. Only updates when calling [method move_and_slide] or [method move_and_slide_with_snap]. + Returns [code]true[/code] if the body collided with a wall on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code]. </description> </method> <method name="move_and_collide"> diff --git a/doc/classes/KinematicBody3D.xml b/doc/classes/KinematicBody3D.xml index 17a6034e9a..a21496de54 100644 --- a/doc/classes/KinematicBody3D.xml +++ b/doc/classes/KinematicBody3D.xml @@ -59,21 +59,21 @@ <return type="bool"> </return> <description> - Returns [code]true[/code] if the body is on the ceiling. Only updates when calling [method move_and_slide] or [method move_and_slide_with_snap]. + Returns [code]true[/code] if the body collided with the ceiling on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code]. </description> </method> <method name="is_on_floor" qualifiers="const"> <return type="bool"> </return> <description> - Returns [code]true[/code] if the body is on the floor. Only updates when calling [method move_and_slide] or [method move_and_slide_with_snap]. + Returns [code]true[/code] if the body collided with the floor on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code]. </description> </method> <method name="is_on_wall" qualifiers="const"> <return type="bool"> </return> <description> - Returns [code]true[/code] if the body is on a wall. Only updates when calling [method move_and_slide] or [method move_and_slide_with_snap]. + Returns [code]true[/code] if the body collided with a wall on the last call of [method move_and_slide] or [method move_and_slide_with_snap]. Otherwise, returns [code]false[/code]. </description> </method> <method name="move_and_collide"> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index fed936cc2f..2d475fc449 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -12,7 +12,6 @@ <methods> </methods> <members> - <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" override="true" enum="Control.FocusMode" default="0" /> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" /> <member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" override="true" enum="Control.CursorShape" default="2" /> <member name="text" type="String" setter="set_text" getter="get_text" default=""""> diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index cf1fdb5ba6..d97e0f0f21 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -30,7 +30,6 @@ </methods> <members> <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" override="true" enum="BaseButton.ActionMode" default="0" /> - <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" override="true" enum="Control.FocusMode" default="0" /> <member name="flat" type="bool" setter="set_flat" getter="is_flat" override="true" default="true" /> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="0" /> <member name="switch_on_hover" type="bool" setter="set_switch_on_hover" getter="is_switch_on_hover" default="false"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index e9865a6198..8f683eeac3 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -469,7 +469,7 @@ [b]Note:[/b] This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it. </member> <member name="editor/script_templates_search_path" type="String" setter="" getter="" default=""res://script_templates""> - Search path for project-specific script templates. Script templates will be search both in the editor-specific path and in this project-specific path. + Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path. </member> <member name="editor/search_in_file_extensions" type="PackedStringArray" setter="" getter="" default="PackedStringArray( "gd", "shader" )"> Text-based file extensions to include in the script editor's "Find in Files" feature. You can add e.g. [code]tscn[/code] if you wish to also parse your scene files, especially if you use built-in scripts which are serialized in the scene files. diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp index 422534a2e1..639da371bd 100644 --- a/editor/editor_run_native.cpp +++ b/editor/editor_run_native.cpp @@ -76,8 +76,10 @@ void EditorRunNative::_notification(int p_what) { } else { mb->get_popup()->clear(); mb->show(); - mb->set_tooltip(eep->get_options_tooltip()); - if (dc > 1) { + if (dc == 1) { + mb->set_tooltip(eep->get_option_tooltip(0)); + } else { + mb->set_tooltip(eep->get_options_tooltip()); for (int i = 0; i < dc; i++) { mb->get_popup()->add_icon_item(eep->get_option_icon(i), eep->get_option_label(i)); mb->get_popup()->set_item_tooltip(mb->get_popup()->get_item_count() - 1, eep->get_option_tooltip(i)); diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 8cd8aaf277..9261113706 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -89,6 +89,25 @@ void TileMapEditor::_notification(int p_what) { case NOTIFICATION_EXIT_TREE: { get_tree()->disconnect("node_removed", callable_mp(this, &TileMapEditor::_node_removed)); } break; + + case NOTIFICATION_APPLICATION_FOCUS_OUT: { + if (tool == TOOL_PAINTING) { + Vector<int> ids = get_selected_tiles(); + + if (ids.size() > 0 && ids[0] != TileMap::INVALID_CELL) { + _set_cell(over_tile, ids, flip_h, flip_v, transpose); + _finish_undo(); + + paint_undo.clear(); + } + + tool = TOOL_NONE; + _update_button_tool(); + } + + // set flag to ignore over_tile on refocus + refocus_over_tile = true; + } break; } } @@ -1299,6 +1318,12 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { CanvasItemEditor::get_singleton()->update_viewport(); } + if (refocus_over_tile) { + // editor lost focus; forget last tile position + old_over_tile = new_over_tile; + refocus_over_tile = false; + } + int tile_under = node->get_cell(over_tile.x, over_tile.y); String tile_name = "none"; diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h index 996e904853..f57616db1f 100644 --- a/editor/plugins/tile_map_editor_plugin.h +++ b/editor/plugins/tile_map_editor_plugin.h @@ -119,6 +119,7 @@ class TileMapEditor : public VBoxContainer { Rect2i rectangle; Point2i over_tile; + bool refocus_over_tile = false; bool *bucket_cache_visited; Rect2i bucket_cache_rect; diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index 76c0e0e607..eb599df74c 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -264,6 +264,7 @@ RigidBodyBullet::RigidBodyBullet() : btRigidBody::btRigidBodyConstructionInfo cInfo(mass, godotMotionState, nullptr, localInertia); btBody = bulletnew(btRigidBody(cInfo)); + btBody->setFriction(1.0); reload_shapes(); setupBulletCollisionObject(btBody); diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index a05b38b8bf..70b731d611 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -975,7 +975,6 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { script->signals_invalidated = true; script->reload(p_soft_reload); - script->update_exports(); if (!script->valid) { script->pending_reload_instances.clear(); @@ -2955,13 +2954,24 @@ void CSharpScript::initialize_for_managed_type(Ref<CSharpScript> p_script, GDMon CRASH_COND(p_script->native == nullptr); + p_script->valid = true; + + update_script_class_info(p_script); + +#ifdef TOOLS_ENABLED + p_script->_update_member_info_no_exports(); +#endif +} + +// Extract information about the script using the mono class. +void CSharpScript::update_script_class_info(Ref<CSharpScript> p_script) { GDMonoClass *base = p_script->script_class->get_parent_class(); + // `base` should only be set if the script is a user defined type. if (base != p_script->native) { p_script->base = base; } - p_script->valid = true; p_script->tool = p_script->script_class->has_attribute(CACHED_CLASS(ToolAttribute)); if (!p_script->tool) { @@ -2996,17 +3006,74 @@ void CSharpScript::initialize_for_managed_type(Ref<CSharpScript> p_script, GDMon p_script->script_class->fetch_methods_with_godot_api_checks(p_script->native); - // Need to fetch method from base classes as well + p_script->rpc_functions.clear(); + p_script->rpc_variables.clear(); + GDMonoClass *top = p_script->script_class; while (top && top != p_script->native) { + // Fetch methods from base classes as well top->fetch_methods_with_godot_api_checks(p_script->native); + + // Update RPC info + { + Vector<GDMonoMethod *> methods = top->get_all_methods(); + for (int i = 0; i < methods.size(); i++) { + if (!methods[i]->is_static()) { + MultiplayerAPI::RPCMode mode = p_script->_member_get_rpc_mode(methods[i]); + if (MultiplayerAPI::RPC_MODE_DISABLED != mode) { + ScriptNetData nd; + nd.name = methods[i]->get_name(); + nd.mode = mode; + if (-1 == p_script->rpc_functions.find(nd)) { + p_script->rpc_functions.push_back(nd); + } + } + } + } + } + + { + Vector<GDMonoField *> fields = top->get_all_fields(); + for (int i = 0; i < fields.size(); i++) { + if (!fields[i]->is_static()) { + MultiplayerAPI::RPCMode mode = p_script->_member_get_rpc_mode(fields[i]); + if (MultiplayerAPI::RPC_MODE_DISABLED != mode) { + ScriptNetData nd; + nd.name = fields[i]->get_name(); + nd.mode = mode; + if (-1 == p_script->rpc_variables.find(nd)) { + p_script->rpc_variables.push_back(nd); + } + } + } + } + } + + { + Vector<GDMonoProperty *> properties = top->get_all_properties(); + for (int i = 0; i < properties.size(); i++) { + if (!properties[i]->is_static()) { + MultiplayerAPI::RPCMode mode = p_script->_member_get_rpc_mode(properties[i]); + if (MultiplayerAPI::RPC_MODE_DISABLED != mode) { + ScriptNetData nd; + nd.name = properties[i]->get_name(); + nd.mode = mode; + if (-1 == p_script->rpc_variables.find(nd)) { + p_script->rpc_variables.push_back(nd); + } + } + } + } + } + top = top->get_parent_class(); } + // Sort so we are 100% that they are always the same. + p_script->rpc_functions.sort_custom<SortNetData>(); + p_script->rpc_variables.sort_custom<SortNetData>(); + p_script->load_script_signals(p_script->script_class, p_script->native); -#ifdef TOOLS_ENABLED - p_script->_update_member_info_no_exports(); -#endif } bool CSharpScript::can_instance() const { @@ -3305,124 +3372,15 @@ Error CSharpScript::reload(bool p_keep_state) { print_verbose("Found class " + script_class->get_full_name() + " for script " + get_path()); #endif - tool = script_class->has_attribute(CACHED_CLASS(ToolAttribute)); - - if (!tool) { - GDMonoClass *nesting_class = script_class->get_nesting_class(); - tool = nesting_class && nesting_class->has_attribute(CACHED_CLASS(ToolAttribute)); - } - -#if TOOLS_ENABLED - if (!tool) { - tool = script_class->get_assembly() == GDMono::get_singleton()->get_tools_assembly(); - } -#endif - native = GDMonoUtils::get_class_native_base(script_class); CRASH_COND(native == nullptr); - GDMonoClass *base_class = script_class->get_parent_class(); - - if (base_class != native) { - base = base_class; - } - -#ifdef DEBUG_ENABLED - // For debug builds, we must fetch from all native base methods as well. - // Native base methods must be fetched before the current class. - // Not needed if the script class itself is a native class. + update_script_class_info(this); - if (script_class != native) { - GDMonoClass *native_top = native; - while (native_top) { - native_top->fetch_methods_with_godot_api_checks(native); - - if (native_top == CACHED_CLASS(GodotObject)) { - break; - } - - native_top = native_top->get_parent_class(); - } - } -#endif - - script_class->fetch_methods_with_godot_api_checks(native); - - // Need to fetch method from base classes as well - GDMonoClass *top = script_class; - while (top && top != native) { - top->fetch_methods_with_godot_api_checks(native); - top = top->get_parent_class(); - } - - load_script_signals(script_class, native); _update_exports(); } - rpc_functions.clear(); - rpc_variables.clear(); - - GDMonoClass *top = script_class; - while (top && top != native) { - { - Vector<GDMonoMethod *> methods = top->get_all_methods(); - for (int i = 0; i < methods.size(); i++) { - if (!methods[i]->is_static()) { - MultiplayerAPI::RPCMode mode = _member_get_rpc_mode(methods[i]); - if (MultiplayerAPI::RPC_MODE_DISABLED != mode) { - ScriptNetData nd; - nd.name = methods[i]->get_name(); - nd.mode = mode; - if (-1 == rpc_functions.find(nd)) { - rpc_functions.push_back(nd); - } - } - } - } - } - - { - Vector<GDMonoField *> fields = top->get_all_fields(); - for (int i = 0; i < fields.size(); i++) { - if (!fields[i]->is_static()) { - MultiplayerAPI::RPCMode mode = _member_get_rpc_mode(fields[i]); - if (MultiplayerAPI::RPC_MODE_DISABLED != mode) { - ScriptNetData nd; - nd.name = fields[i]->get_name(); - nd.mode = mode; - if (-1 == rpc_variables.find(nd)) { - rpc_variables.push_back(nd); - } - } - } - } - } - - { - Vector<GDMonoProperty *> properties = top->get_all_properties(); - for (int i = 0; i < properties.size(); i++) { - if (!properties[i]->is_static()) { - MultiplayerAPI::RPCMode mode = _member_get_rpc_mode(properties[i]); - if (MultiplayerAPI::RPC_MODE_DISABLED != mode) { - ScriptNetData nd; - nd.name = properties[i]->get_name(); - nd.mode = mode; - if (-1 == rpc_variables.find(nd)) { - rpc_variables.push_back(nd); - } - } - } - } - } - - top = top->get_parent_class(); - } - - // Sort so we are 100% that they are always the same. - rpc_functions.sort_custom<SortNetData>(); - rpc_variables.sort_custom<SortNetData>(); - return OK; } diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index f0b43a40f9..cfe070a371 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -164,6 +164,7 @@ private: // Do not use unless you know what you are doing friend void GDMonoInternals::tie_managed_to_unmanaged(MonoObject *, Object *); static Ref<CSharpScript> create_for_managed_type(GDMonoClass *p_class, GDMonoClass *p_native); + static void update_script_class_info(Ref<CSharpScript> p_script); static void initialize_for_managed_type(Ref<CSharpScript> p_script, GDMonoClass *p_class, GDMonoClass *p_native); MultiplayerAPI::RPCMode _member_get_rpc_mode(IMonoClassMember *p_member) const; diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index f13377f3c8..68de686272 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -2088,6 +2088,7 @@ void VisualScriptPropertyGet::_bind_methods() { BIND_ENUM_CONSTANT(CALL_MODE_SELF); BIND_ENUM_CONSTANT(CALL_MODE_NODE_PATH); BIND_ENUM_CONSTANT(CALL_MODE_INSTANCE); + BIND_ENUM_CONSTANT(CALL_MODE_BASIC_TYPE); } class VisualScriptNodeInstancePropertyGet : public VisualScriptNodeInstance { diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 2e77d20d4e..a759e329da 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -307,17 +307,6 @@ int BaseButton::get_button_mask() const { return button_mask; } -void BaseButton::set_enabled_focus_mode(FocusMode p_mode) { - enabled_focus_mode = p_mode; - if (!status.disabled) { - set_focus_mode(p_mode); - } -} - -Control::FocusMode BaseButton::get_enabled_focus_mode() const { - return enabled_focus_mode; -} - void BaseButton::set_keep_pressed_outside(bool p_on) { keep_pressed_outside = p_on; } @@ -388,8 +377,6 @@ void BaseButton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_button_mask", "mask"), &BaseButton::set_button_mask); ClassDB::bind_method(D_METHOD("get_button_mask"), &BaseButton::get_button_mask); ClassDB::bind_method(D_METHOD("get_draw_mode"), &BaseButton::get_draw_mode); - ClassDB::bind_method(D_METHOD("set_enabled_focus_mode", "mode"), &BaseButton::set_enabled_focus_mode); - ClassDB::bind_method(D_METHOD("get_enabled_focus_mode"), &BaseButton::get_enabled_focus_mode); ClassDB::bind_method(D_METHOD("set_keep_pressed_outside", "enabled"), &BaseButton::set_keep_pressed_outside); ClassDB::bind_method(D_METHOD("is_keep_pressed_outside"), &BaseButton::is_keep_pressed_outside); @@ -412,7 +399,6 @@ void BaseButton::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed"); ADD_PROPERTY(PropertyInfo(Variant::INT, "action_mode", PROPERTY_HINT_ENUM, "Button Press,Button Release"), "set_action_mode", "get_action_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "button_mask", PROPERTY_HINT_FLAGS, "Mouse Left, Mouse Right, Mouse Middle"), "set_button_mask", "get_button_mask"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "enabled_focus_mode", PROPERTY_HINT_ENUM, "None,Click,All"), "set_enabled_focus_mode", "get_enabled_focus_mode"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keep_pressed_outside"), "set_keep_pressed_outside", "is_keep_pressed_outside"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shortcut", PROPERTY_HINT_RESOURCE_TYPE, "Shortcut"), "set_shortcut", "get_shortcut"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "group", PROPERTY_HINT_RESOURCE_TYPE, "ButtonGroup"), "set_button_group", "get_button_group"); @@ -437,7 +423,6 @@ BaseButton::BaseButton() { status.pressing_inside = false; status.disabled = false; set_focus_mode(FOCUS_ALL); - enabled_focus_mode = FOCUS_ALL; action_mode = ACTION_MODE_BUTTON_RELEASE; button_mask = BUTTON_MASK_LEFT; } diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h index 8e71931f8b..33f19949cd 100644 --- a/scene/gui/base_button.h +++ b/scene/gui/base_button.h @@ -49,7 +49,6 @@ private: bool toggle_mode; bool shortcut_in_tooltip; bool keep_pressed_outside; - FocusMode enabled_focus_mode; Ref<Shortcut> shortcut; ActionMode action_mode; @@ -115,9 +114,6 @@ public: void set_button_mask(int p_mask); int get_button_mask() const; - void set_enabled_focus_mode(FocusMode p_mode); - FocusMode get_enabled_focus_mode() const; - void set_shortcut(const Ref<Shortcut> &p_shortcut); Ref<Shortcut> get_shortcut() const; diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp index f8c8bd4caf..27a60945c8 100644 --- a/scene/gui/link_button.cpp +++ b/scene/gui/link_button.cpp @@ -127,6 +127,5 @@ void LinkButton::_bind_methods() { LinkButton::LinkButton() { underline_mode = UNDERLINE_MODE_ALWAYS; - set_enabled_focus_mode(FOCUS_NONE); set_default_cursor_shape(CURSOR_POINTING_HAND); } diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index aa69fb39e7..9b1738ec79 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -130,7 +130,6 @@ MenuButton::MenuButton() { set_flat(true); set_toggle_mode(true); set_disable_shortcuts(false); - set_enabled_focus_mode(FOCUS_NONE); set_process_unhandled_key_input(true); set_action_mode(ACTION_MODE_BUTTON_PRESS); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 2f5ee20373..318496df70 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1173,6 +1173,9 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 if (p_item->cells[i].text.size() > 0) { float icon_width = p_item->cells[i].get_icon_size().width; + if (p_item->get_icon_max_width(i) > 0) { + icon_width = p_item->get_icon_max_width(i); + } r.position.x += icon_width; r.size.x -= icon_width; } |