MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _update_title

Method _update_title

editor/editor_node.cpp:367–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367void 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
385void EditorNode::_update_unsaved_cache() {
386 bool is_unsaved = EditorUndoRedoManager::get_singleton()->is_history_unsaved(EditorUndoRedoManager::GLOBAL_HISTORY) ||

Callers

nothing calls this directly

Calls 9

TTRFunction · 0.85
vformatFunction · 0.85
get_scene_file_pathMethod · 0.80
StringClass · 0.50
is_emptyMethod · 0.45
get_edited_scene_rootMethod · 0.45
get_fileMethod · 0.45
window_set_titleMethod · 0.45
set_textMethod · 0.45

Tested by

no test coverage detected