Extract BottomPanel from EditorNode

This commit is contained in:
kit
2024-01-30 17:22:22 -05:00
parent 1aab6e96b9
commit eb6ca91ba6
22 changed files with 438 additions and 315 deletions

View File

@@ -42,6 +42,7 @@
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/filesystem_dock.h"
#include "editor/gui/editor_bottom_panel.h"
#include "editor/themes/editor_scale.h"
#include "editor/window_wrapper.h"
@@ -196,7 +197,7 @@ void EditorDockManager::_dock_select_input(const Ref<InputEvent> &p_input) {
if (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && mb->is_pressed()) {
if (dock_bottom_selected_idx != -1) {
EditorNode::get_singleton()->remove_bottom_panel_item(bottom_docks[dock_bottom_selected_idx]);
EditorNode::get_bottom_panel()->remove_item(bottom_docks[dock_bottom_selected_idx]);
bottom_docks[dock_bottom_selected_idx]->call("_set_dock_horizontal", false);
@@ -391,13 +392,13 @@ void EditorDockManager::_dock_move_selected_to_bottom() {
dock->call("_set_dock_horizontal", true);
bottom_docks.push_back(dock);
EditorNode::get_singleton()->add_bottom_panel_item(dock->get_name(), dock, true);
EditorNode::get_bottom_panel()->add_item(dock->get_name(), dock, true);
dock_select_popup->hide();
update_dock_slots_visibility(true);
_edit_current();
emit_signal(SNAME("layout_changed"));
EditorNode::get_singleton()->make_bottom_panel_item_visible(dock);
EditorNode::get_bottom_panel()->make_item_visible(dock);
}
void EditorDockManager::_dock_make_float(Control *p_dock, int p_slot_index, bool p_show_window) {
@@ -601,7 +602,7 @@ void EditorDockManager::load_docks_from_config(Ref<ConfigFile> p_layout, const S
dock_slot[atidx]->set_block_signals(false);
} else if (bottom_idx != -1) {
bottom_docks.erase(node);
EditorNode::get_singleton()->remove_bottom_panel_item(node);
EditorNode::get_bottom_panel()->remove_item(node);
dock_slot[i]->add_child(node);
node->call("_set_dock_horizontal", false);
}
@@ -662,7 +663,7 @@ void EditorDockManager::load_docks_from_config(Ref<ConfigFile> p_layout, const S
node->call("_set_dock_horizontal", true);
bottom_docks.push_back(node);
EditorNode::get_singleton()->add_bottom_panel_item(node->get_name(), node, true);
EditorNode::get_bottom_panel()->add_item(node->get_name(), node, true);
}
}