From 2031c92f7a24cd3daf7502cd619c1d4cc9d751cd Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 15 Aug 2022 22:10:59 +0200 Subject: [PATCH] Add source code tooltip to function selection list. --- server/TracySourceView.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 98ddf427..e9d26b41 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -1287,6 +1287,18 @@ void SourceView::RenderSymbolView( Worker& worker, View& view ) ImGui::Spacing(); ImGui::SameLine(); ImGui::TextDisabled( "%s:%i", file, line ); + if( ImGui::IsItemHovered() && SourceFileValid( file, worker.GetCaptureTime(), view, worker ) ) + { + m_sourceTooltip.Parse( file, worker, view ); + if( !m_sourceTooltip.empty() ) + { + ImGui::BeginTooltip(); + SetFont(); + PrintSourceFragment( m_sourceTooltip, line, 4, 7 ); + UnsetFont(); + ImGui::EndTooltip(); + } + } ImGui::NextColumn(); ImGui::TextDisabled( "0x%" PRIx64, v.first ); ImGui::NextColumn();