1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-03 16:55:53 +00:00

Make bottom panel into available dock slot

This commit is contained in:
kobewi
2025-11-15 13:31:08 +01:00
parent b79fe2e020
commit 67735cf213
30 changed files with 594 additions and 422 deletions

View File

@@ -81,12 +81,12 @@ void EditorPlugin::remove_autoload_singleton(const String &p_name) {
EditorNode::get_singleton()->get_project_settings()->get_autoload_settings()->autoload_remove(p_name);
}
#ifndef DISABLE_DEPRECATED
Button *EditorPlugin::add_control_to_bottom_panel(Control *p_control, const String &p_title, const Ref<Shortcut> &p_shortcut) {
ERR_FAIL_NULL_V(p_control, nullptr);
return EditorNode::get_bottom_panel()->add_item(p_title, p_control, p_shortcut);
}
#ifndef DISABLE_DEPRECATED
void EditorPlugin::add_control_to_dock(DockSlot p_slot, Control *p_control, const Ref<Shortcut> &p_shortcut) {
ERR_FAIL_NULL(p_control);
ERR_FAIL_COND(legacy_docks.has(p_control));
@@ -94,7 +94,7 @@ void EditorPlugin::add_control_to_dock(DockSlot p_slot, Control *p_control, cons
EditorDock *dock = memnew(EditorDock);
dock->set_title(p_control->get_name());
dock->set_dock_shortcut(p_shortcut);
dock->set_default_slot((EditorDockManager::DockSlot)p_slot);
dock->set_default_slot((DockConstants::DockSlot)p_slot);
dock->add_child(p_control);
legacy_docks[p_control] = dock;
@@ -115,12 +115,12 @@ void EditorPlugin::set_dock_tab_icon(Control *p_control, const Ref<Texture2D> &p
ERR_FAIL_COND(!legacy_docks.has(p_control));
legacy_docks[p_control]->set_dock_icon(p_icon);
}
#endif
void EditorPlugin::remove_control_from_bottom_panel(Control *p_control) {
ERR_FAIL_NULL(p_control);
EditorNode::get_bottom_panel()->remove_item(p_control);
}
#endif
void EditorPlugin::add_dock(EditorDock *p_dock) {
EditorDockManager::get_singleton()->add_dock(p_dock);
@@ -622,8 +622,6 @@ void EditorPlugin::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_dock", "dock"), &EditorPlugin::add_dock);
ClassDB::bind_method(D_METHOD("remove_dock", "dock"), &EditorPlugin::remove_dock);
ClassDB::bind_method(D_METHOD("add_control_to_container", "container", "control"), &EditorPlugin::add_control_to_container);
ClassDB::bind_method(D_METHOD("add_control_to_bottom_panel", "control", "title", "shortcut"), &EditorPlugin::add_control_to_bottom_panel, DEFVAL(Ref<Shortcut>()));
ClassDB::bind_method(D_METHOD("remove_control_from_bottom_panel", "control"), &EditorPlugin::remove_control_from_bottom_panel);
ClassDB::bind_method(D_METHOD("remove_control_from_container", "container", "control"), &EditorPlugin::remove_control_from_container);
ClassDB::bind_method(D_METHOD("add_tool_menu_item", "name", "callable"), &EditorPlugin::add_tool_menu_item);
ClassDB::bind_method(D_METHOD("add_tool_submenu_item", "name", "submenu"), &EditorPlugin::add_tool_submenu_item);
@@ -636,6 +634,8 @@ void EditorPlugin::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_control_to_dock", "slot", "control", "shortcut"), &EditorPlugin::add_control_to_dock, DEFVAL(Ref<Shortcut>()));
ClassDB::bind_method(D_METHOD("remove_control_from_docks", "control"), &EditorPlugin::remove_control_from_docks);
ClassDB::bind_method(D_METHOD("set_dock_tab_icon", "control", "icon"), &EditorPlugin::set_dock_tab_icon);
ClassDB::bind_method(D_METHOD("add_control_to_bottom_panel", "control", "title", "shortcut"), &EditorPlugin::add_control_to_bottom_panel, DEFVAL(Ref<Shortcut>()));
ClassDB::bind_method(D_METHOD("remove_control_from_bottom_panel", "control"), &EditorPlugin::remove_control_from_bottom_panel);
#endif
ClassDB::bind_method(D_METHOD("add_autoload_singleton", "name", "path"), &EditorPlugin::add_autoload_singleton);
@@ -734,6 +734,7 @@ void EditorPlugin::_bind_methods() {
BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_BL);
BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_UR);
BIND_ENUM_CONSTANT(DOCK_SLOT_RIGHT_BR);
BIND_ENUM_CONSTANT(DOCK_SLOT_BOTTOM);
BIND_ENUM_CONSTANT(DOCK_SLOT_MAX);
BIND_ENUM_CONSTANT(AFTER_GUI_INPUT_PASS);