From 5bee7533767832b65939913393bffa62519e5300 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 24 Jul 2022 00:18:57 +0200 Subject: [PATCH] Add source preview to lock info window source location. --- server/TracyView_Locks.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/server/TracyView_Locks.cpp b/server/TracyView_Locks.cpp index eda3b93e..c21949bc 100644 --- a/server/TracyView_Locks.cpp +++ b/server/TracyView_Locks.cpp @@ -988,15 +988,19 @@ void View::DrawLockInfoWindow() ImGui::SameLine(); } ImGui::TextUnformatted( LocationToString( 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_lockInfoAnim.Enable( m_lockInfoWindow, 0.5f ); + if( SourceFileValid( fileName, m_worker.GetCaptureTime(), *this, m_worker ) ) + { + ViewSource( fileName, srcloc.line ); + } + else + { + m_lockInfoAnim.Enable( m_lockInfoWindow, 0.5f ); + } } } ImGui::Separator();