From 0bbda5ea117cefe4b087be11621fc845c1b441fc Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 20 Apr 2021 18:13:15 +0200 Subject: [PATCH] Pressing Z will temporarily switch child calls. --- server/TracySourceView.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index a52dbd78..e26042b9 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -1118,18 +1118,22 @@ void SourceView::RenderSymbolView( const Worker& worker, View& view ) GatherAdditionalIpStats( m_symAddr, iptotalSrc, iptotalAsm, ipcountSrc, ipcountAsm, ipmaxSrc, ipmaxAsm, worker, limitView, view ); iptotalSrc = iptotalAsm; } + const auto slzReady = worker.AreSourceLocationZonesReady(); if( ( iptotalAsm.local + iptotalAsm.ext ) > 0 || ( view.m_statRange.active && worker.GetSamplesForSymbol( m_baseAddr ) ) ) { ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); - const auto slzReady = worker.AreSourceLocationZonesReady(); if( !slzReady ) { ImGui::PushItemFlag( ImGuiItemFlags_Disabled, true ); ImGui::PushStyleVar( ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f ); m_childCalls = false; } + else if( ImGui::IsKeyDown( 'Z' ) ) + { + m_childCalls = !m_childCalls; + } SmallCheckbox( ICON_FA_SIGN_OUT_ALT " Child calls", &m_childCalls ); if( !slzReady ) { @@ -1142,6 +1146,15 @@ void SourceView::RenderSymbolView( const Worker& worker, View& view ) ImGui::EndTooltip(); } } + else + { + if( ImGui::IsItemHovered() ) + { + ImGui::BeginTooltip(); + ImGui::TextUnformatted( "Press Z key to temporarily reverse selection." ); + ImGui::EndTooltip(); + } + } ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); @@ -1238,6 +1251,8 @@ void SourceView::RenderSymbolView( const Worker& worker, View& view ) break; } + if( slzReady && ImGui::IsKeyDown( 'Z' ) ) m_childCalls = !m_childCalls; + if( jumpOut != 0 ) { auto sym = worker.GetSymbolData( jumpOut );