From 19c4985cef616780908c0eb053fa6b0703454719 Mon Sep 17 00:00:00 2001 From: Maksim Lin Date: Fri, 20 Dec 2024 14:53:03 +1100 Subject: [PATCH] show project name on as title on project screen --- sources/Application/Views/ProjectView.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sources/Application/Views/ProjectView.cpp b/sources/Application/Views/ProjectView.cpp index a7f0b548..17946253 100644 --- a/sources/Application/Views/ProjectView.cpp +++ b/sources/Application/Views/ProjectView.cpp @@ -191,13 +191,15 @@ void ProjectView::DrawView() { GUITextProperties props; GUIPoint pos = GetTitlePosition(); + SetColor(CD_NORMAL); + // Draw title - char projectString[SCREEN_WIDTH + 1]; - npf_snprintf(projectString, sizeof(projectString), "Project - Build %s%s_%s", - PROJECT_NUMBER, PROJECT_RELEASE, BUILD_COUNT); + const char *title = "Project "; + DrawString(pos._x, pos._y, title, props); - SetColor(CD_NORMAL); - DrawString(pos._x, pos._y, projectString, props); + Variable *v = viewData_->project_->FindVariable(FourCC::VarProjectName); + etl::string projectName = v->GetString(); + DrawString(pos._x + strlen(title), pos._y, projectName.c_str(), props); drawBattery(props);