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 );
|
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; } );
|
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 );
|
ImGui::Begin( "CPU data", &m_showCpuDataWindow );
|
||||||
TextFocused( "Tracked threads:", RealToString( ctd.size(), true ) );
|
TextFocused( "Tracked threads:", RealToString( ctd.size(), true ) );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
@ -10444,6 +10446,11 @@ void View::DrawCpuDataWindow()
|
|||||||
for( auto& pidit : psort )
|
for( auto& pidit : psort )
|
||||||
{
|
{
|
||||||
auto& pid = *pidit;
|
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 pidtxt = pid.first == 0 ? "Unknown" : RealToString( pid.first, true );
|
||||||
const auto expand = ImGui::TreeNode( pidtxt );
|
const auto expand = ImGui::TreeNode( pidtxt );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
@ -10481,6 +10488,10 @@ void View::DrawCpuDataWindow()
|
|||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
}
|
}
|
||||||
|
if( pidMatch )
|
||||||
|
{
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndColumns();
|
ImGui::EndColumns();
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
|
Loading…
Reference in New Issue
Block a user