diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-08-22 08:42:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 08:42:43 +0200 |
commit | 57e3a1a95176bb45cd15cbb657bc984826f59000 (patch) | |
tree | 86a34d0061d98b7d9b7ea10a4960f5de79dcf015 /editor | |
parent | 9396d408c889a263140b8fa45cbcbf80cafa9bb3 (diff) | |
parent | c8afe63a5434420fed5b2798386776673037f36d (diff) |
Merge pull request #47673 from Calinou/improve-editor-window-title
Improve the editor window title for better usability
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 3adb7688b0..08585030de 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -388,14 +388,16 @@ void EditorNode::_version_control_menu_option(int p_idx) { } void EditorNode::_update_title() { - String appname = ProjectSettings::get_singleton()->get("application/config/name"); - String title = appname.is_empty() ? String(VERSION_FULL_NAME) : String(VERSION_NAME + String(" - ") + appname); - String edited = editor_data.get_edited_scene_root() ? editor_data.get_edited_scene_root()->get_filename() : String(); + const String appname = ProjectSettings::get_singleton()->get("application/config/name"); + String title = (appname.is_empty() ? "Unnamed Project" : appname) + String(" - ") + VERSION_NAME; + const String edited = editor_data.get_edited_scene_root() ? editor_data.get_edited_scene_root()->get_filename() : String(); if (!edited.is_empty()) { - title += " - " + String(edited.get_file()); + // Display the edited scene name before the program name so that it can be seen in the OS task bar. + title = vformat("%s - %s", edited.get_file(), title); } if (unsaved_cache) { - title += " (*)"; + // Display the "modified" mark before anything else so that it can always be seen in the OS task bar. + title = vformat("(*) %s", title); } DisplayServer::get_singleton()->window_set_title(title); |