Make zone info child list "selectable".

This commit is contained in:
Bartosz Taudul 2018-03-04 18:40:32 +01:00
parent a7e7f59f96
commit f44e9bbd7b

View File

@ -2458,21 +2458,15 @@ void View::DrawZoneInfoWindow()
{ {
auto& cev = *ev.child[cti[i]]; auto& cev = *ev.child[cti[i]];
const auto& csl = m_worker.GetSourceLocation( cev.srcloc ); 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 ) ); m_zoneInfoWindow = &cev;
}
else
{
ImGui::Text( "%s", m_worker.GetString( csl.function ) );
} }
if( ImGui::IsItemHovered() ) if( ImGui::IsItemHovered() )
{ {
m_zoneHighlight = &cev; m_zoneHighlight = &cev;
if( ImGui::IsMouseClicked( 0 ) )
{
m_zoneInfoWindow = &cev;
}
if( ImGui::IsMouseClicked( 2 ) ) if( ImGui::IsMouseClicked( 2 ) )
{ {
ZoomToZone( cev ); ZoomToZone( cev );