diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2019-08-16 19:27:46 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2019-08-16 19:39:03 +0300 |
commit | 7e81f3250e5b1f240cab6968e28148b794fe46a2 (patch) | |
tree | b3b6cb435b3751ea3ffa3b31add6ce23bd4d3657 /server/TracyView.cpp | |
parent | 8e71e2dba57a7bc56eeb7b0120657232fe3f926d (diff) |
Add CPU tooltip.
Diffstat (limited to 'server/TracyView.cpp')
-rw-r--r-- | server/TracyView.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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; } |