Add CPU tooltip.

This commit is contained in:
Bartosz Taudul 2019-08-16 18:27:46 +02:00
parent 8e71e2dba5
commit 7e81f3250e

View File

@ -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;
}