Shorten frame names in callstack table.

This commit is contained in:
Bartosz Taudul 2022-08-15 17:44:02 +02:00
parent f2001c95a5
commit 7f99ee2c13
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -208,10 +208,30 @@ void View::DrawCallstackTable( uint32_t callstack, bool globalEntriesButton )
{
TextColoredUnformatted( 0xFF8888FF, txt );
}
else
else if( m_shortenName == ShortenName::Never )
{
ImGui::TextUnformatted( txt );
}
else
{
const auto normalized = ShortenZoneName( ShortenName::OnlyNormalize, txt );
ImGui::TextUnformatted( normalized );
if( ImGui::IsItemHovered() && normalized != txt && strcmp( normalized, txt ) != 0 )
{
if( ImGui::CalcTextSize( txt ).x > 1400 * GetScale() )
{
ImGui::SetNextWindowSize( ImVec2( 1400 * GetScale(), 0 ) );
ImGui::BeginTooltip();
ImGui::TextWrapped( "%s", txt );
}
else
{
ImGui::BeginTooltip();
ImGui::TextUnformatted( txt );
}
ImGui::EndTooltip();
}
}
ImGui::PopTextWrapPos();
}
if( ImGui::IsItemClicked() )