diff options
Diffstat (limited to 'editor/action_map_editor.cpp')
-rw-r--r-- | editor/action_map_editor.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index 01be5ae4fe..698390a61e 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -136,10 +136,9 @@ void InputEventConfigurationDialog::_set_event(const Ref<InputEvent> &p_event, b TreeItem *input_item = category->get_first_child(); if (input_item != nullptr) { - // has_type this should be always true, unless the tree structure has been misconfigured. - bool has_type = input_item->get_parent()->has_meta("__type"); - int input_type = input_item->get_parent()->get_meta("__type"); - if (!has_type) { + // input_type should always be > 0, unless the tree structure has been misconfigured. + int input_type = input_item->get_parent()->get_meta("__type", 0); + if (input_type == 0) { return; } @@ -645,6 +644,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { tab_container = memnew(TabContainer); tab_container->set_use_hidden_tabs_for_min_size(true); tab_container->set_v_size_flags(Control::SIZE_EXPAND_FILL); + tab_container->set_theme_type_variation("TabContainerOdd"); tab_container->connect("tab_selected", callable_mp(this, &InputEventConfigurationDialog::_tab_selected)); main_vbox->add_child(tab_container); @@ -869,7 +869,11 @@ void ActionMapEditor::_action_edited() { } } -void ActionMapEditor::_tree_button_pressed(Object *p_item, int p_column, int p_id) { +void ActionMapEditor::_tree_button_pressed(Object *p_item, int p_column, int p_id, MouseButton p_button) { + if (p_button != MouseButton::LEFT) { + return; + } + ItemButton option = (ItemButton)p_id; TreeItem *item = Object::cast_to<TreeItem>(p_item); @@ -927,7 +931,7 @@ void ActionMapEditor::_tree_item_activated() { return; } - _tree_button_pressed(item, 2, BUTTON_EDIT_EVENT); + _tree_button_pressed(item, 2, BUTTON_EDIT_EVENT, MouseButton::LEFT); } void ActionMapEditor::set_show_builtin_actions(bool p_show) { @@ -1250,7 +1254,7 @@ ActionMapEditor::ActionMapEditor() { action_tree->set_column_custom_minimum_width(2, 50 * EDSCALE); action_tree->connect("item_edited", callable_mp(this, &ActionMapEditor::_action_edited)); action_tree->connect("item_activated", callable_mp(this, &ActionMapEditor::_tree_item_activated)); - action_tree->connect("button_pressed", callable_mp(this, &ActionMapEditor::_tree_button_pressed)); + action_tree->connect("button_clicked", callable_mp(this, &ActionMapEditor::_tree_button_pressed)); main_vbox->add_child(action_tree); action_tree->set_drag_forwarding(this); |