From 7e81f3250e5b1f240cab6968e28148b794fe46a2 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 16 Aug 2019 18:27:46 +0200 Subject: [PATCH] Add CPU tooltip. --- server/TracyView.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 4ed853f0..e0021eb3 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3995,7 +3995,17 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, char buf[32]; sprintf( buf, "CPU %i", i ); + const auto txtx = ImGui::CalcTextSize( buf ).x; DrawTextContrast( draw, wpos + ImVec2( ty, offset-1 ), 0xFFDD88DD, buf ); + if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, offset-1 ), wpos + ImVec2( sty + txtx, offset + sty - 1 ) ) ) + { + ImGui::PopFont(); + ImGui::BeginTooltip(); + TextFocused( "CPU:", RealToString( i, true ) ); + TextFocused( "Context switch regions:", RealToString( cs.size(), true ) ); + ImGui::EndTooltip(); + ImGui::PushFont( m_smallFont ); + } } offset += sstep; }