1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Highlight zones with opened zone info window.

This commit is contained in:
Bartosz Taudul 2018-04-02 14:38:08 +02:00
parent 50eb5c4b84
commit 8cc446b578

View File

@ -3731,7 +3731,7 @@ void View::ListMemData( T ptr, T end, std::function<MemEvent*(T&)> DrawAddress )
const auto& srcloc = m_worker.GetSourceLocation( zone->srcloc ); const auto& srcloc = m_worker.GetSourceLocation( zone->srcloc );
const auto txt = srcloc.name.active ? m_worker.GetString( srcloc.name ) : m_worker.GetString( srcloc.function ); const auto txt = srcloc.name.active ? m_worker.GetString( srcloc.name ) : m_worker.GetString( srcloc.function );
ImGui::PushID( idx++ ); ImGui::PushID( idx++ );
auto sel = ImGui::Selectable( txt, false ); auto sel = ImGui::Selectable( txt, m_zoneInfoWindow == zone );
auto hover = ImGui::IsItemHovered(); auto hover = ImGui::IsItemHovered();
ImGui::PopID(); ImGui::PopID();
if( sel ) if( sel )
@ -3768,13 +3768,13 @@ void View::ListMemData( T ptr, T end, std::function<MemEvent*(T&)> DrawAddress )
bool sel; bool sel;
if( zoneFree == zone ) if( zoneFree == zone )
{ {
sel = ImGui::Selectable( "", false ); sel = ImGui::Selectable( "", m_zoneInfoWindow == zoneFree );
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextColored( ImVec4( 1.f, 1.f, 0.6f, 1.f ), txt ); ImGui::TextColored( ImVec4( 1.f, 1.f, 0.6f, 1.f ), txt );
} }
else else
{ {
sel = ImGui::Selectable( txt, false ); sel = ImGui::Selectable( txt, m_zoneInfoWindow == zoneFree );
} }
auto hover = ImGui::IsItemHovered(); auto hover = ImGui::IsItemHovered();
ImGui::PopID(); ImGui::PopID();