1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-03 14:03:52 +00:00

Display trace descriptions in compare menu.

This commit is contained in:
Bartosz Taudul 2019-07-26 23:33:49 +02:00
parent be3b458f28
commit f2cdb64aae

View File

@ -7196,7 +7196,17 @@ void View::DrawCompare()
#endif #endif
TextDisabledUnformatted( "This trace:" ); TextDisabledUnformatted( "This trace:" );
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextUnformatted( m_worker.GetCaptureName().c_str() ); const auto& desc0 = m_userData.GetDescription();
if( desc0.empty() )
{
ImGui::TextUnformatted( m_worker.GetCaptureName().c_str() );
}
else
{
ImGui::TextUnformatted( desc0.c_str() );
ImGui::SameLine();
ImGui::TextDisabled( "(%s)", m_worker.GetCaptureName().c_str() );
}
#ifdef TRACY_EXTENDED_FONT #ifdef TRACY_EXTENDED_FONT
TextColoredUnformatted( ImVec4( 0xDD/255.f, 0x22/255.f, 0x22/255.f, 1.f ), ICON_FA_GEM ); TextColoredUnformatted( ImVec4( 0xDD/255.f, 0x22/255.f, 0x22/255.f, 1.f ), ICON_FA_GEM );
@ -7204,19 +7214,16 @@ void View::DrawCompare()
#endif #endif
TextDisabledUnformatted( "External trace:" ); TextDisabledUnformatted( "External trace:" );
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextUnformatted( m_compare.second->GetCaptureName().c_str() ); const auto& desc1 = m_compare.userData->GetDescription();
ImGui::SameLine(); if( desc1.empty() )
#ifdef TRACY_EXTENDED_FONT
if( ImGui::SmallButton( ICON_FA_TRASH_ALT " Unload" ) )
#else
if( ImGui::SmallButton( "Unload" ) )
#endif
{ {
m_compare.Reset(); ImGui::TextUnformatted( m_compare.second->GetCaptureName().c_str() );
m_compare.second.reset(); }
m_compare.userData.reset(); else
ImGui::End(); {
return; ImGui::TextUnformatted( desc1.c_str() );
ImGui::SameLine();
ImGui::TextDisabled( "(%s)", m_compare.second->GetCaptureName().c_str() );
} }
bool findClicked = false; bool findClicked = false;
@ -7244,6 +7251,22 @@ void View::DrawCompare()
ImGui::Checkbox( "Ignore case", &m_compare.ignoreCase ); ImGui::Checkbox( "Ignore case", &m_compare.ignoreCase );
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
#ifdef TRACY_EXTENDED_FONT
if( ImGui::Button( ICON_FA_TRASH_ALT " Unload" ) )
#else
if( ImGui::Button( "Unload" ) )
#endif
{
m_compare.Reset();
m_compare.second.reset();
m_compare.userData.reset();
ImGui::End();
return;
}
if( findClicked ) if( findClicked )
{ {
m_compare.Reset(); m_compare.Reset();