From 366da56d9998f83f01f47149e5dabefe4bfbc94c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 29 Sep 2017 22:38:38 +0200 Subject: [PATCH] Add interaction with displayed child nodes. --- server/TracyView.cpp | 17 +++++++++++++++++ server/TracyView.hpp | 1 + 2 files changed, 18 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index ccb2f187..459f319e 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -743,6 +743,7 @@ void View::DrawImpl() ImGui::Text( "Frames: %-7" PRIu64 " Time span: %-10s View span: %-10s Zones: %-10" PRIu64" Queue delay: %s Timer resolution: %s", m_frames.size(), TimeToString( GetLastTime() - m_frames[0] ), TimeToString( m_zvEnd - m_zvStart ), m_zonesCnt, TimeToString( m_delay ), TimeToString( m_resolution ) ); DrawFrames(); DrawZones(); + m_zoneHighlight = nullptr; DrawZoneInfoWindow(); ImGui::End(); @@ -1342,6 +1343,18 @@ void View::DrawZoneInfoWindow() auto& srcloc = GetSourceLocation( cev.srcloc ); ImGui::Text( "%s", GetString( srcloc.function ) ); } + if( ImGui::IsItemHovered() ) + { + m_zoneHighlight = &cev; + if( ImGui::IsMouseClicked( 0 ) ) + { + m_zoneInfoWindow = &cev; + } + if( ImGui::IsMouseClicked( 2 ) ) + { + ZoomToZone( cev ); + } + } ImGui::NextColumn(); ImGui::Text( "%s (%.2f%%)", TimeToString( ctt[cti[i]] ), double( ctt[cti[i]] ) / ztime ); ImGui::NextColumn(); @@ -1360,6 +1373,10 @@ uint32_t View::GetZoneHighlight( const Event& ev ) { return 0xFF44DD44; } + else if( m_zoneHighlight == &ev ) + { + return 0xFF4444FF; + } else { return 0xAAAAAAAA; diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 551f7a53..a80e0b4e 100755 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -141,6 +141,7 @@ private: double m_timerMul; const Event* m_zoneInfoWindow; + const Event* m_zoneHighlight; }; }