From 6f63b0c9ae58d8910a3997572c2afb1607192dc8 Mon Sep 17 00:00:00 2001 From: "Andrii Doroshenko (Xrayez)" Date: Tue, 8 Jun 2021 00:51:18 +0300 Subject: [PATCH] Separate version hash from version number in editor and project manager When copy-pasting the version from About dialog to bug reports at GitHub, this makes the version hash linkable to commits at GitHub. (cherry picked from commit 293550f56ad732ce27d042f6fca8fe8476669d15) --- editor/editor_about.cpp | 2 +- editor/editor_node.cpp | 2 +- editor/project_manager.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index 5333d03583d..7af0d557b00 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -146,7 +146,7 @@ EditorAbout::EditorAbout() { version_btn = memnew(LinkButton); String hash = String(VERSION_HASH); if (hash.length() != 0) { - hash = "." + hash.left(9); + hash = " " + vformat("[%s]", hash.left(9)); } version_btn->set_text(VERSION_FULL_NAME + hash); // Set the text to copy in metadata as it slightly differs from the button's text. diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f1b435646b5..6eec5fa4c78 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6796,7 +6796,7 @@ EditorNode::EditorNode() { version_btn->set_text(VERSION_FULL_CONFIG); String hash = String(VERSION_HASH); if (hash.length() != 0) { - hash = "." + hash.left(9); + hash = " " + vformat("[%s]", hash.left(9)); } // Set the text to copy in metadata as it slightly differs from the button's text. version_btn->set_meta(META_TEXT_TO_COPY, "v" VERSION_FULL_BUILD + hash); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 015915d4d21..75e245d983a 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2673,7 +2673,7 @@ ProjectManager::ProjectManager() { version_btn = memnew(LinkButton); String hash = String(VERSION_HASH); if (hash.length() != 0) { - hash = "." + hash.left(9); + hash = " " + vformat("[%s]", hash.left(9)); } version_btn->set_text("v" VERSION_FULL_BUILD + hash); // Fade the version label to be less prominent, but still readable.