You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Allow to disable History Dock via feature profile
This commit is contained in:
@@ -5976,12 +5976,14 @@ void EditorNode::_feature_profile_changed() {
|
||||
TabContainer *import_tabs = cast_to<TabContainer>(ImportDock::get_singleton()->get_parent());
|
||||
TabContainer *node_tabs = cast_to<TabContainer>(NodeDock::get_singleton()->get_parent());
|
||||
TabContainer *fs_tabs = cast_to<TabContainer>(FileSystemDock::get_singleton()->get_parent());
|
||||
TabContainer *history_tabs = cast_to<TabContainer>(history_dock->get_parent());
|
||||
if (profile.is_valid()) {
|
||||
node_tabs->set_tab_hidden(node_tabs->get_tab_idx_from_control(NodeDock::get_singleton()), profile->is_feature_disabled(EditorFeatureProfile::FEATURE_NODE_DOCK));
|
||||
// The Import dock is useless without the FileSystem dock. Ensure the configuration is valid.
|
||||
bool fs_dock_disabled = profile->is_feature_disabled(EditorFeatureProfile::FEATURE_FILESYSTEM_DOCK);
|
||||
fs_tabs->set_tab_hidden(fs_tabs->get_tab_idx_from_control(FileSystemDock::get_singleton()), fs_dock_disabled);
|
||||
import_tabs->set_tab_hidden(import_tabs->get_tab_idx_from_control(ImportDock::get_singleton()), fs_dock_disabled || profile->is_feature_disabled(EditorFeatureProfile::FEATURE_IMPORT_DOCK));
|
||||
history_tabs->set_tab_hidden(history_tabs->get_tab_idx_from_control(history_dock), profile->is_feature_disabled(EditorFeatureProfile::FEATURE_HISTORY_DOCK));
|
||||
|
||||
main_editor_buttons[EDITOR_3D]->set_visible(!profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D));
|
||||
main_editor_buttons[EDITOR_SCRIPT]->set_visible(!profile->is_feature_disabled(EditorFeatureProfile::FEATURE_SCRIPT));
|
||||
@@ -5997,6 +5999,8 @@ void EditorNode::_feature_profile_changed() {
|
||||
import_tabs->set_tab_hidden(import_tabs->get_tab_idx_from_control(ImportDock::get_singleton()), false);
|
||||
node_tabs->set_tab_hidden(node_tabs->get_tab_idx_from_control(NodeDock::get_singleton()), false);
|
||||
fs_tabs->set_tab_hidden(fs_tabs->get_tab_idx_from_control(FileSystemDock::get_singleton()), false);
|
||||
history_tabs->set_tab_hidden(history_tabs->get_tab_idx_from_control(history_dock), false);
|
||||
history_dock->set_visible(true);
|
||||
ImportDock::get_singleton()->set_visible(true);
|
||||
NodeDock::get_singleton()->set_visible(true);
|
||||
FileSystemDock::get_singleton()->set_visible(true);
|
||||
@@ -7108,7 +7112,7 @@ EditorNode::EditorNode() {
|
||||
filesystem_dock->connect("display_mode_changed", callable_mp(this, &EditorNode::_save_docks));
|
||||
get_project_settings()->connect_filesystem_dock_signals(filesystem_dock);
|
||||
|
||||
HistoryDock *hd = memnew(HistoryDock);
|
||||
history_dock = memnew(HistoryDock);
|
||||
|
||||
// Scene: Top left.
|
||||
dock_slot[DOCK_SLOT_LEFT_UR]->add_child(SceneTreeDock::get_singleton());
|
||||
@@ -7131,8 +7135,8 @@ EditorNode::EditorNode() {
|
||||
dock_slot[DOCK_SLOT_RIGHT_UL]->set_tab_title(dock_slot[DOCK_SLOT_RIGHT_UL]->get_tab_idx_from_control(NodeDock::get_singleton()), TTR("Node"));
|
||||
|
||||
// History: Full height right, behind Node.
|
||||
dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(hd);
|
||||
dock_slot[DOCK_SLOT_RIGHT_UL]->set_tab_title(dock_slot[DOCK_SLOT_RIGHT_UL]->get_tab_idx_from_control(hd), TTR("History"));
|
||||
dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(history_dock);
|
||||
dock_slot[DOCK_SLOT_RIGHT_UL]->set_tab_title(dock_slot[DOCK_SLOT_RIGHT_UL]->get_tab_idx_from_control(history_dock), TTR("History"));
|
||||
|
||||
// Hide unused dock slots and vsplits.
|
||||
dock_slot[DOCK_SLOT_LEFT_UL]->hide();
|
||||
|
||||
Reference in New Issue
Block a user