From c38764db3c14ecbb6691468fda2372c5d8a18459 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 7 Feb 2025 02:21:52 +0100 Subject: [PATCH] Add appropriate tooltips for image names. --- profiler/src/profiler/TracyView_Samples.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/profiler/src/profiler/TracyView_Samples.cpp b/profiler/src/profiler/TracyView_Samples.cpp index e1fbde4c..24de706a 100644 --- a/profiler/src/profiler/TracyView_Samples.cpp +++ b/profiler/src/profiler/TracyView_Samples.cpp @@ -528,10 +528,15 @@ void View::DrawSamplesStatistics( Vector& data, int64_t timeRange, Accu while( end > imageName && *end != '/' && *end != '\\' ) end--; if( *end == '/' || *end == '\\' ) end++; TextDisabledUnformatted( end ); + TooltipIfHovered( imageName ); } else { + const char* end = imageName + strlen( imageName ); + const auto cw = ImGui::GetContentRegionAvail().x; + const auto tw = ImGui::CalcTextSize( imageName, end ).x; TextDisabledUnformatted( imageName ); + if( tw > cw ) TooltipIfHovered( imageName ); } ImGui::TableNextColumn(); const auto baseCnt = cnt;