mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 08:14:34 +00:00
Add CPU tooltip.
This commit is contained in:
parent
8e71e2dba5
commit
7e81f3250e
@ -3995,7 +3995,17 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover,
|
|||||||
|
|
||||||
char buf[32];
|
char buf[32];
|
||||||
sprintf( buf, "CPU %i", i );
|
sprintf( buf, "CPU %i", i );
|
||||||
|
const auto txtx = ImGui::CalcTextSize( buf ).x;
|
||||||
DrawTextContrast( draw, wpos + ImVec2( ty, offset-1 ), 0xFFDD88DD, buf );
|
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;
|
offset += sstep;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user