From a15ba0c7fb8cfabb696bfa27264d3fd1a3ddbd86 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 27 Mar 2021 13:47:20 +0100 Subject: [PATCH] Show source preview tooltip in find zones. --- server/TracyView.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 72e3181f..bf79e187 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -9527,15 +9527,19 @@ void View::DrawFindZone() } const auto fileName = m_worker.GetString( srcloc.file ); ImGui::TextColored( ImVec4( 0.5, 0.5, 0.5, 1 ), "(%s) %s:%i", RealToString( zones.size() ), fileName, srcloc.line ); - if( ImGui::IsItemClicked( 1 ) ) + if( ImGui::IsItemHovered() ) { - if( SourceFileValid( fileName, m_worker.GetCaptureTime(), *this, m_worker ) ) + DrawSourceTooltip( fileName, srcloc.line ); + if( ImGui::IsItemClicked( 1 ) ) { - ViewSource( fileName, srcloc.line ); - } - else - { - m_findZoneBuzzAnim.Enable( idx, 0.5f ); + if( SourceFileValid( fileName, m_worker.GetCaptureTime(), *this, m_worker ) ) + { + ViewSource( fileName, srcloc.line ); + } + else + { + m_findZoneBuzzAnim.Enable( idx, 0.5f ); + } } } ImGui::PopID();