diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-29 13:16:01 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-29 13:16:01 +0100 |
commit | 0796d08b8f8bf590074b9b09f878f933ce867bdd (patch) | |
tree | d2f7f3e00af3e02b96bbdc7f7f02b956ecfd59b7 /editor/editor_node.cpp | |
parent | 07d290e67e008e8c1d839271ad57a19db0f6be06 (diff) | |
parent | 04a930d9a696ca984d2962d8001c50cb65593f29 (diff) | |
download | redot-engine-0796d08b8f8bf590074b9b09f878f933ce867bdd.tar.gz |
Merge pull request #84515 from Calinou/editor-multi-window-unavailable-disable-buttons
Disable multi-window buttons instead of hiding them when support is unavailable
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 928deb588c..23d5704048 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3715,6 +3715,10 @@ bool EditorNode::is_scene_open(const String &p_path) { return false; } +bool EditorNode::is_multi_window_enabled() const { + return !SceneTree::get_singleton()->get_root()->is_embedding_subwindows() && !EDITOR_GET("interface/editor/single_window_mode") && EDITOR_GET("interface/multi_window/enable"); +} + void EditorNode::fix_dependencies(const String &p_for_file) { dependency_fixer->edit(p_for_file); } @@ -4126,6 +4130,20 @@ void EditorNode::request_instantiate_scenes(const Vector<String> &p_files) { SceneTreeDock::get_singleton()->instantiate_scenes(p_files); } +String EditorNode::get_multiwindow_support_tooltip_text() const { + if (SceneTree::get_singleton()->get_root()->is_embedding_subwindows()) { + if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SUBWINDOWS)) { + return TTR("Multi-window support is not available because the `--single-window` command line argument was used to start the editor."); + } else { + return TTR("Multi-window support is not available because the current platform doesn't support multiple windows."); + } + } else if (EDITOR_GET("interface/editor/single_window_mode")) { + return TTR("Multi-window support is not available because Interface > Editor > Single Window Mode is enabled in the editor settings."); + } + + return TTR("Multi-window support is not available because Interface > Multi Window > Enable is disabled in the editor settings."); +} + void EditorNode::_inherit_request(String p_file) { current_menu_option = FILE_NEW_INHERITED_SCENE; _dialog_action(p_file); |