From a7cdffa73609147b8be89f9363c818bba9edb054 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 5 Dec 2020 14:13:35 +0100 Subject: [PATCH] Use tables for trace parameters. --- server/TracyView.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index b3a9b5a1..ee5afa22 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1541,17 +1541,17 @@ bool View::DrawConnection() ImGui::Separator(); if( ImGui::TreeNode( "Trace parameters" ) ) { - ImGui::Columns( 2 ); - ImGui::TextUnformatted( "Name" ); - ImGui::NextColumn(); - ImGui::TextUnformatted( "Value" ); - ImGui::NextColumn(); - ImGui::Separator(); + ImGui::BeginTable( "##traceparams", 2, ImGuiTableFlags_Borders ); + ImGui::TableSetupColumn( "Name" ); + ImGui::TableSetupColumn( "Value", ImGuiTableColumnFlags_WidthAutoResize ); + ImGui::TableHeadersRow(); size_t idx = 0; for( auto& p : params ) { + ImGui::TableNextRow(); + ImGui::TableNextColumn(); ImGui::TextUnformatted( m_worker.GetString( p.name ) ); - ImGui::NextColumn(); + ImGui::TableNextColumn(); ImGui::PushID( idx ); if( p.isBool ) { @@ -1570,10 +1570,9 @@ bool View::DrawConnection() } } ImGui::PopID(); - ImGui::NextColumn(); idx++; } - ImGui::EndColumns(); + ImGui::EndTable(); ImGui::TreePop(); } }