mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Highlight current process.
This commit is contained in:
parent
ae9cae781a
commit
2eed28b19f
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user