| 365 | } |
| 366 | |
| 367 | void EditorNode::_update_title() { |
| 368 | const String appname = GLOBAL_GET("application/config/name"); |
| 369 | String title = (appname.is_empty() ? TTR("Unnamed Project") : appname); |
| 370 | const String edited = editor_data.get_edited_scene_root() ? editor_data.get_edited_scene_root()->get_scene_file_path() : String(); |
| 371 | if (!edited.is_empty()) { |
| 372 | // Display the edited scene name before the program name so that it can be seen in the OS task bar. |
| 373 | title = vformat("%s - %s", edited.get_file(), title); |
| 374 | } |
| 375 | if (unsaved_cache) { |
| 376 | // Display the "modified" mark before anything else so that it can always be seen in the OS task bar. |
| 377 | title = vformat("(*) %s", title); |
| 378 | } |
| 379 | DisplayServer::get_singleton()->window_set_title(title + String(" - ") + REDOT_VERSION_NAME); |
| 380 | if (project_title) { |
| 381 | project_title->set_text(title); |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | void EditorNode::_update_unsaved_cache() { |
| 386 | bool is_unsaved = EditorUndoRedoManager::get_singleton()->is_history_unsaved(EditorUndoRedoManager::GLOBAL_HISTORY) || |
nothing calls this directly
no test coverage detected