diff options
author | Thomas Herzog <karroffel@users.noreply.github.com> | 2017-07-11 00:11:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-11 00:11:03 +0200 |
commit | 34edac54e3fe1e5bd34f662143f039920a55ff3b (patch) | |
tree | 7a33cd5d02f99a92eac79c1a9e77952ffd4ccb7b /editor | |
parent | e5334fdd29b75099de2fb10e1f57e57df4b95a51 (diff) | |
parent | 29c2aabdafca48cbc6aee6b2d4e1f09c8164abc2 (diff) |
Merge pull request #9510 from kubecz3k/tab-reposition
ability to reposition scene tabs with drag & drop
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 7 | ||||
-rw-r--r-- | editor/editor_node.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index a83906ddf3..2f50842a52 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4436,6 +4436,11 @@ void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) { } } +void EditorNode::_reposition_active_tab(int idx_to) { + editor_data.move_edited_scene_to_index(idx_to); + _update_scene_tabs(); +} + void EditorNode::_thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata) { int p_tab = p_udata.operator signed int(); if (p_preview.is_valid()) { @@ -5025,6 +5030,7 @@ void EditorNode::_bind_methods() { ClassDB::bind_method("_scene_tab_hover", &EditorNode::_scene_tab_hover); ClassDB::bind_method("_scene_tab_exit", &EditorNode::_scene_tab_exit); ClassDB::bind_method("_scene_tab_input", &EditorNode::_scene_tab_input); + ClassDB::bind_method("_reposition_active_tab", &EditorNode::_reposition_active_tab); ClassDB::bind_method("_thumbnail_done", &EditorNode::_thumbnail_done); ClassDB::bind_method("_scene_tab_script_edited", &EditorNode::_scene_tab_script_edited); ClassDB::bind_method("_set_main_scene_state", &EditorNode::_set_main_scene_state); @@ -5399,6 +5405,7 @@ EditorNode::EditorNode() { scene_tabs->connect("tab_hover", this, "_scene_tab_hover"); scene_tabs->connect("mouse_exited", this, "_scene_tab_exit"); scene_tabs->connect("gui_input", this, "_scene_tab_input"); + scene_tabs->connect("reposition_active_tab_request", this, "_reposition_active_tab"); HBoxContainer *tabbar_container = memnew(HBoxContainer); scene_tabs->set_h_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/editor_node.h b/editor/editor_node.h index 49ac04243c..991cf1df71 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -572,6 +572,7 @@ private: void _scene_tab_hover(int p_tab); void _scene_tab_exit(); void _scene_tab_input(const Ref<InputEvent> &p_input); + void _reposition_active_tab(int idx_to); void _thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata); void _scene_tab_script_edited(int p_tab); |