1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Add an option to display only the file part of image name.

This commit is contained in:
Bartosz Taudul 2025-02-07 02:17:40 +01:00
parent 3ac95e6902
commit 408939862b
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 14 additions and 1 deletions

View File

@ -517,6 +517,7 @@ private:
AccumulationMode m_statAccumulationMode = AccumulationMode::SelfOnly;
bool m_statSampleTime = true;
int m_statMode = 0;
bool m_shortImageNames = false;
int m_flameMode = 0;
bool m_flameSort = false;
bool m_flameRunningTime = false;

View File

@ -522,7 +522,17 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
ImGui::Unindent( indentVal );
}
ImGui::TableNextColumn();
TextDisabledUnformatted( imageName );
if( m_shortImageNames )
{
const char* end = imageName + strlen( imageName ) - 1;
while( end > imageName && *end != '/' && *end != '\\' ) end--;
if( *end == '/' || *end == '\\' ) end++;
TextDisabledUnformatted( end );
}
else
{
TextDisabledUnformatted( imageName );
}
ImGui::TableNextColumn();
const auto baseCnt = cnt;
if( cnt > 0 )

View File

@ -474,6 +474,8 @@ void View::DrawStatistics()
{
TextDisabledUnformatted( "Image" );
ImGui::SameLine();
ToggleButton( ICON_FA_SCISSORS, m_shortImageNames );
ImGui::SameLine();
m_statisticsImageFilter.Draw( ICON_FA_FILTER "###imageFilter", 200 );
ImGui::SameLine();
if( ImGui::BeginCombo( "###imageCombo", nullptr, ImGuiComboFlags_NoPreview | ImGuiComboFlags_HeightLarge ) )