From f44e9bbd7be80f5941a018551e90782d3b441925 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 4 Mar 2018 18:40:32 +0100 Subject: [PATCH] Make zone info child list "selectable". --- server/TracyView.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index d2c1ebaf..3c79874f 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2458,21 +2458,15 @@ void View::DrawZoneInfoWindow() { auto& cev = *ev.child[cti[i]]; const auto& csl = m_worker.GetSourceLocation( cev.srcloc ); - if( csl.name.active ) + const auto txt = csl.name.active ? m_worker.GetString( csl.name ) : m_worker.GetString( csl.function ); + bool b = false; + if( ImGui::Selectable( txt, &b, ImGuiSelectableFlags_SpanAllColumns ) ) { - ImGui::Text( "%s", m_worker.GetString( csl.name ) ); - } - else - { - ImGui::Text( "%s", m_worker.GetString( csl.function ) ); + m_zoneInfoWindow = &cev; } if( ImGui::IsItemHovered() ) { m_zoneHighlight = &cev; - if( ImGui::IsMouseClicked( 0 ) ) - { - m_zoneInfoWindow = &cev; - } if( ImGui::IsMouseClicked( 2 ) ) { ZoomToZone( cev );