Adapt frame graph tooltip to look more like zone tooltip.

This commit is contained in:
Bartosz Taudul 2024-09-08 15:41:44 +02:00
parent 97cf0bd11f
commit 0d8b2b6252
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -163,9 +163,25 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct
for( auto& v : item.children ) self -= v.time;
ImGui::BeginTooltip();
TextFocused( "Name:", name );
TextFocused( "Time:", TimeToString( item.time ) );
if( !item.children.empty() ) TextFocused( "Self time:", TimeToString( self ) );
if( srcloc.name.active )
{
ImGui::TextUnformatted( m_worker.GetString( srcloc.name ) );
}
ImGui::TextUnformatted( m_worker.GetString( srcloc.function ) );
ImGui::Separator();
SmallColorBox( GetSrcLocColor( srcloc, 0 ) );
ImGui::SameLine();
ImGui::TextUnformatted( LocationToString( m_worker.GetString( srcloc.file ), srcloc.line ) );
ImGui::Separator();
TextFocused( "Execution time:", TimeToString( item.time ) );
if( !item.children.empty() )
{
TextFocused( "Self time:", TimeToString( self ) );
char buf[64];
PrintStringPercent( buf, 100.f * self / item.time );
ImGui::SameLine();
TextDisabledUnformatted( buf );
}
ImGui::EndTooltip();
if( ImGui::IsMouseClicked( 0 ) )