summaryrefslogtreecommitdiffstats
path: root/editor/plugins/editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-05-08 14:35:29 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-05-08 14:35:29 +0200
commit0fcd30180f95331b367e5dc6ab8141f04e00e55e (patch)
treee446ebe9f22799ab6b7ce6c90ea87cc71df2ccc0 /editor/plugins/editor_plugin.cpp
parent2fb9da093b7484b46213f2282e7b7a707661bc89 (diff)
parent1e206129403ef47da2c9251ce7e78a90bd923dab (diff)
downloadredot-engine-0fcd30180f95331b367e5dc6ab8141f04e00e55e.tar.gz
Merge pull request #91039 from timothyqiu/dock-icons
Allow setting editor dock tabs to icon only
Diffstat (limited to 'editor/plugins/editor_plugin.cpp')
-rw-r--r--editor/plugins/editor_plugin.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/plugins/editor_plugin.cpp b/editor/plugins/editor_plugin.cpp
index f42a1555a2..2b3c187352 100644
--- a/editor/plugins/editor_plugin.cpp
+++ b/editor/plugins/editor_plugin.cpp
@@ -100,6 +100,11 @@ void EditorPlugin::remove_control_from_bottom_panel(Control *p_control) {
EditorNode::get_bottom_panel()->remove_item(p_control);
}
+void EditorPlugin::set_dock_tab_icon(Control *p_control, const Ref<Texture2D> &p_icon) {
+ ERR_FAIL_NULL(p_control);
+ EditorDockManager::get_singleton()->set_dock_tab_icon(p_control, p_icon);
+}
+
void EditorPlugin::add_control_to_container(CustomControlContainer p_location, Control *p_control) {
ERR_FAIL_NULL(p_control);
@@ -565,6 +570,7 @@ void EditorPlugin::_bind_methods() {
ClassDB::bind_method(D_METHOD("remove_control_from_docks", "control"), &EditorPlugin::remove_control_from_docks);
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("set_dock_tab_icon", "control", "icon"), &EditorPlugin::set_dock_tab_icon);
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);
ClassDB::bind_method(D_METHOD("remove_tool_menu_item", "name"), &EditorPlugin::remove_tool_menu_item);