From d6bf19a7629054450b9553e7f832afa96b96a45f Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 28 Mar 2018 01:53:59 +0200 Subject: [PATCH] Standard zone list behavior in zone trace. --- server/TracyView.cpp | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 89af876f..b2205df5 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2470,9 +2470,23 @@ void View::DrawZoneInfoWindow() { const auto& srcloc = m_worker.GetSourceLocation( v->srcloc ); const auto txt = srcloc.name.active ? m_worker.GetString( srcloc.name ) : m_worker.GetString( srcloc.function ); - ImGui::Text( "%s", txt ); + auto sel = ImGui::Selectable( txt, false ); + auto hover = ImGui::IsItemHovered(); ImGui::SameLine(); ImGui::TextDisabled( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line ); + if( sel ) + { + m_zoneInfoWindow = v; + } + if( hover ) + { + m_zoneHighlight = v; + if( ImGui::IsMouseClicked( 2 ) ) + { + ZoomToZone( *v ); + } + ZoneTooltip( *v ); + } } ImGui::TreePop(); } @@ -2610,9 +2624,23 @@ void View::DrawGpuInfoWindow() { const auto& srcloc = m_worker.GetSourceLocation( v->srcloc ); const auto txt = srcloc.name.active ? m_worker.GetString( srcloc.name ) : m_worker.GetString( srcloc.function ); - ImGui::Text( "%s", txt ); + auto sel = ImGui::Selectable( txt, false ); + auto hover = ImGui::IsItemHovered(); ImGui::SameLine(); ImGui::TextDisabled( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line ); + if( sel ) + { + m_gpuInfoWindow = v; + } + if( hover ) + { + m_gpuHighlight = v; + if( ImGui::IsMouseClicked( 2 ) ) + { + ZoomToZone( *v ); + } + ZoneTooltip( *v ); + } } ImGui::TreePop(); }