From 2eed28b19f9fbb1f8e958716f8b4c8c58daf76a9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 18 Aug 2019 14:46:59 +0200 Subject: [PATCH] Highlight current process. --- server/TracyView.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 75d6d67a..ee295db0 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -10423,6 +10423,8 @@ void View::DrawCpuDataWindow() for( auto it = pids.begin(); it != pids.end(); ++it ) psort.emplace_back( it ); pdqsort_branchless( psort.begin(), psort.end(), [] ( const auto& l, const auto& r ) { return l->first < r->first; } ); + const auto thisPid = m_worker.GetPid(); + ImGui::Begin( "CPU data", &m_showCpuDataWindow ); TextFocused( "Tracked threads:", RealToString( ctd.size(), true ) ); ImGui::SameLine(); @@ -10444,6 +10446,11 @@ void View::DrawCpuDataWindow() for( auto& pidit : psort ) { auto& pid = *pidit; + const auto pidMatch = thisPid != 0 && thisPid == pid.first; + if( pidMatch ) + { + ImGui::PushStyleColor( ImGuiCol_Text, ImVec4( 0.2f, 1.0f, 0.2f, 1.0f ) ); + } const auto pidtxt = pid.first == 0 ? "Unknown" : RealToString( pid.first, true ); const auto expand = ImGui::TreeNode( pidtxt ); ImGui::NextColumn(); @@ -10481,6 +10488,10 @@ void View::DrawCpuDataWindow() ImGui::TreePop(); ImGui::Separator(); } + if( pidMatch ) + { + ImGui::PopStyleColor(); + } } ImGui::EndColumns(); ImGui::EndChild();