From eb7064f13d9307e869a3150067a0e6e54a9a456b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 5 Aug 2018 13:33:18 +0200 Subject: [PATCH] Display frame set tooltip. --- server/TracyView.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 904ae242..08e097d7 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1055,6 +1055,7 @@ bool View::DrawZoneFrames( const FrameData& frames ) int64_t prev = -1; int64_t prevEnd = -1; + bool tooltipDisplayed = false; for( int i = zrange.first; i < zrange.second; i++ ) { @@ -1065,6 +1066,8 @@ bool View::DrawZoneFrames( const FrameData& frames ) if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns, 0 ), wpos + ImVec2( ( fend - m_zvStart ) * pxns, ty ) ) ) { + tooltipDisplayed = true; + ImGui::BeginTooltip(); ImGui::Text( "%s", GetFrameText( frames, i, ftime, m_worker.GetFrameOffset() ) ); ImGui::Separator(); @@ -1168,6 +1171,15 @@ bool View::DrawZoneFrames( const FrameData& frames ) draw->AddLine( wpos + ImVec2( ( fend - m_zvStart ) * pxns, 0 ), wpos + ImVec2( ( fend - m_zvStart ) * pxns, wh ), 0x22FFFFFF ); } + if( hover && !tooltipDisplayed ) + { + ImGui::BeginTooltip(); + ImGui::TextDisabled( "Frame set:" ); + ImGui::SameLine(); + ImGui::Text( "%s", frames.name == 0 ? "Frames" : m_worker.GetString( frames.name ) ); + ImGui::EndTooltip(); + } + return hover; }