mirror of
https://github.com/wolfpld/tracy
synced 2025-05-02 13:43:52 +00:00
Use tables for call stack view.
This commit is contained in:
parent
325bcc035a
commit
f1d48b1298
@ -13246,30 +13246,14 @@ void View::DrawCallstackWindow()
|
|||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::BeginChild( "##callstack" );
|
if( ImGui::BeginTable( "##callstack", 4, ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_ScrollY ) )
|
||||||
const auto w = ImGui::GetWindowWidth();
|
|
||||||
static bool widthSet = false;
|
|
||||||
ImGui::Columns( 4 );
|
|
||||||
if( !widthSet )
|
|
||||||
{
|
{
|
||||||
widthSet = true;
|
ImGui::TableSetupScrollFreeze( 0, 1 );
|
||||||
ImGui::SetColumnWidth( 0, w * 0.05f );
|
ImGui::TableSetupColumn( "Frame", ImGuiTableColumnFlags_NoHide | ImGuiTableColumnFlags_WidthAutoResize );
|
||||||
ImGui::SetColumnWidth( 1, w * 0.425f );
|
ImGui::TableSetupColumn( "Function" );
|
||||||
ImGui::SetColumnWidth( 2, w * 0.425f );
|
ImGui::TableSetupColumn( "Location" );
|
||||||
ImGui::SetColumnWidth( 3, w * 0.1f );
|
ImGui::TableSetupColumn( "Image" );
|
||||||
}
|
ImGui::TableHeadersRow();
|
||||||
ImGui::TextUnformatted( "Frame" );
|
|
||||||
ImGui::NextColumn();
|
|
||||||
ImGui::TextUnformatted( "Function" );
|
|
||||||
ImGui::SameLine();
|
|
||||||
DrawHelpMarker( "Click on entry to copy it to clipboard." );
|
|
||||||
ImGui::NextColumn();
|
|
||||||
ImGui::TextUnformatted( "Location" );
|
|
||||||
ImGui::SameLine();
|
|
||||||
DrawHelpMarker( "Click on entry to copy it to clipboard.\nRight click on entry to try to open source file." );
|
|
||||||
ImGui::NextColumn();
|
|
||||||
ImGui::TextUnformatted( "Image" );
|
|
||||||
ImGui::NextColumn();
|
|
||||||
|
|
||||||
int fidx = 0;
|
int fidx = 0;
|
||||||
int bidx = 0;
|
int bidx = 0;
|
||||||
@ -13278,9 +13262,10 @@ void View::DrawCallstackWindow()
|
|||||||
auto frameData = m_worker.GetCallstackFrame( entry );
|
auto frameData = m_worker.GetCallstackFrame( entry );
|
||||||
if( !frameData )
|
if( !frameData )
|
||||||
{
|
{
|
||||||
ImGui::Separator();
|
ImGui::TableNextRow();
|
||||||
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text( "%i", fidx++ );
|
ImGui::Text( "%i", fidx++ );
|
||||||
ImGui::NextColumn();
|
ImGui::TableNextColumn();
|
||||||
char buf[32];
|
char buf[32];
|
||||||
sprintf( buf, "%p", (void*)m_worker.GetCanonicalPointer( entry ) );
|
sprintf( buf, "%p", (void*)m_worker.GetCanonicalPointer( entry ) );
|
||||||
ImGui::TextUnformatted( buf );
|
ImGui::TextUnformatted( buf );
|
||||||
@ -13288,9 +13273,6 @@ void View::DrawCallstackWindow()
|
|||||||
{
|
{
|
||||||
ImGui::SetClipboardText( buf );
|
ImGui::SetClipboardText( buf );
|
||||||
}
|
}
|
||||||
ImGui::NextColumn();
|
|
||||||
ImGui::NextColumn();
|
|
||||||
ImGui::NextColumn();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -13316,9 +13298,9 @@ void View::DrawCallstackWindow()
|
|||||||
if( match ) continue;
|
if( match ) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
ImGui::TableNextColumn();
|
||||||
bidx++;
|
bidx++;
|
||||||
|
|
||||||
ImGui::Separator();
|
|
||||||
if( f == fsz-1 )
|
if( f == fsz-1 )
|
||||||
{
|
{
|
||||||
ImGui::Text( "%i", fidx++ );
|
ImGui::Text( "%i", fidx++ );
|
||||||
@ -13327,7 +13309,7 @@ void View::DrawCallstackWindow()
|
|||||||
{
|
{
|
||||||
TextDisabledUnformatted( "inline" );
|
TextDisabledUnformatted( "inline" );
|
||||||
}
|
}
|
||||||
ImGui::NextColumn();
|
ImGui::TableNextColumn();
|
||||||
{
|
{
|
||||||
ImGui::PushTextWrapPos( 0.0f );
|
ImGui::PushTextWrapPos( 0.0f );
|
||||||
if( txt[0] == '[' )
|
if( txt[0] == '[' )
|
||||||
@ -13344,7 +13326,7 @@ void View::DrawCallstackWindow()
|
|||||||
{
|
{
|
||||||
ImGui::SetClipboardText( txt );
|
ImGui::SetClipboardText( txt );
|
||||||
}
|
}
|
||||||
ImGui::NextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::PushTextWrapPos( 0.0f );
|
ImGui::PushTextWrapPos( 0.0f );
|
||||||
float indentVal = 0.f;
|
float indentVal = 0.f;
|
||||||
if( m_callstackBuzzAnim.Match( bidx ) )
|
if( m_callstackBuzzAnim.Match( bidx ) )
|
||||||
@ -13463,18 +13445,16 @@ void View::DrawCallstackWindow()
|
|||||||
ImGui::Unindent( indentVal );
|
ImGui::Unindent( indentVal );
|
||||||
}
|
}
|
||||||
ImGui::PopTextWrapPos();
|
ImGui::PopTextWrapPos();
|
||||||
ImGui::NextColumn();
|
ImGui::TableNextColumn();
|
||||||
if( frameData->imageName.Active() )
|
if( frameData->imageName.Active() )
|
||||||
{
|
{
|
||||||
TextDisabledUnformatted( m_worker.GetString( frameData->imageName ) );
|
TextDisabledUnformatted( m_worker.GetString( frameData->imageName ) );
|
||||||
}
|
}
|
||||||
ImGui::NextColumn();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ImGui::EndTable();
|
||||||
ImGui::EndColumns();
|
}
|
||||||
ImGui::EndChild();
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
if( !show )
|
if( !show )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user