mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Add short images option to callstack / wait stacks window.
This commit is contained in:
parent
ad5615cda2
commit
9b7d53a979
@ -103,6 +103,10 @@ void View::DrawCallstackTable( uint32_t callstack, bool globalEntriesButton )
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
SmallCheckbox( ICON_FA_SCISSORS " Short images", &m_shortImageNames );
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
ImGui::SameLine();
|
||||
ImGui::TextUnformatted( ICON_FA_AT " Frame location:" );
|
||||
ImGui::SameLine();
|
||||
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) );
|
||||
@ -385,7 +389,28 @@ void View::DrawCallstackTable( uint32_t callstack, bool globalEntriesButton )
|
||||
}
|
||||
ImGui::PopTextWrapPos();
|
||||
ImGui::TableNextColumn();
|
||||
if( image ) TextDisabledUnformatted( image );
|
||||
if( image )
|
||||
{
|
||||
const char* end = image + strlen( image );
|
||||
|
||||
if( m_shortImageNames )
|
||||
{
|
||||
const char* ptr = end - 1;
|
||||
while( ptr > image && *ptr != '/' && *ptr != '\\' ) ptr--;
|
||||
if( *ptr == '/' || *ptr == '\\' ) ptr++;
|
||||
const auto cw = ImGui::GetContentRegionAvail().x;
|
||||
const auto tw = ImGui::CalcTextSize( image, end ).x;
|
||||
TextDisabledUnformatted( ptr );
|
||||
if( ptr != image || tw > cw ) TooltipIfHovered( image );
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto cw = ImGui::GetContentRegionAvail().x;
|
||||
const auto tw = ImGui::CalcTextSize( image, end ).x;
|
||||
TextDisabledUnformatted( image );
|
||||
if( tw > cw ) TooltipIfHovered( image );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user