From e5d5af84fdf15696c8744ce075d57b894dafc3c8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 26 Jul 2019 23:21:28 +0200 Subject: [PATCH] Allow setting custom description of the trace. --- server/TracyView.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index ea067078..2f16f389 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -8404,8 +8404,20 @@ void View::DrawInfo() ImGui::SameLine(); const auto version = m_worker.GetTraceVersion(); ImGui::Text( "%i.%i.%i", version >> 16, ( version >> 8 ) & 0xFF, version & 0xFF ); - ImGui::Separator(); + { + const auto& desc = m_userData.GetDescription(); + const auto descsz = std::min( 255, desc.size() ); + char buf[256]; + buf[descsz] = '\0'; + memcpy( buf, desc.c_str(), descsz ); + if( ImGui::InputTextWithHint( "", "Enter description of the trace", buf, 256 ) ) + { + m_userData.SetDescription( buf ); + } + } + + ImGui::Separator(); if( ImGui::TreeNode( "Profiler statistics" ) ) { TextFocused( "Profiler memory usage:", MemSizeToString( memUsage.load( std::memory_order_relaxed ) ) );