Disable multi-window buttons instead of hiding them when support is unavailable

This is more explicit as for why this functionality isn't available
depending on editor settings and current platform.

This also exposes a `EditorInterface.is_multi_window_enabled()` method
so that editor plugins can easily query whether the editor is able and
expected to create multiple windows.
This commit is contained in:
Hugo Locurcio 2023-11-06 12:41:08 +01:00
parent 17e7f85c06
commit 04a930d9a6
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
10 changed files with 81 additions and 30 deletions

View file

@ -235,6 +235,10 @@ bool EditorInterface::is_distraction_free_mode_enabled() const {
return EditorNode::get_singleton()->is_distraction_free_mode_enabled();
}
bool EditorInterface::is_multi_window_enabled() const {
return EditorNode::get_singleton()->is_multi_window_enabled();
}
float EditorInterface::get_editor_scale() const {
return EDSCALE;
}
@ -445,6 +449,7 @@ void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_main_screen_editor", "name"), &EditorInterface::set_main_screen_editor);
ClassDB::bind_method(D_METHOD("set_distraction_free_mode", "enter"), &EditorInterface::set_distraction_free_mode);
ClassDB::bind_method(D_METHOD("is_distraction_free_mode_enabled"), &EditorInterface::is_distraction_free_mode_enabled);
ClassDB::bind_method(D_METHOD("is_multi_window_enabled"), &EditorInterface::is_multi_window_enabled);
ClassDB::bind_method(D_METHOD("get_editor_scale"), &EditorInterface::get_editor_scale);