From a074d18dfa69e39f70eb2b6ff1bc4a36bd3d2eae Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 12 Apr 2020 23:26:02 +0200 Subject: [PATCH] Don't display source files, if none available. --- server/TracySourceView.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 7992a73c..debe9c03 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -856,10 +856,13 @@ void SourceView::RenderSymbolSourceView( uint32_t iptotal, unordered_flat_map ipcount, uint32_t ipmax, const Worker& worker ) { SmallCheckbox( ICON_FA_SEARCH_LOCATION " Relative locations", &m_asmRelative ); - ImGui::SameLine(); - ImGui::Spacing(); - ImGui::SameLine(); - SmallCheckbox( ICON_FA_FILE_IMPORT " Show source locations", &m_asmShowSourceLocation ); + if( !m_sourceFiles.empty() ) + { + ImGui::SameLine(); + ImGui::Spacing(); + ImGui::SameLine(); + SmallCheckbox( ICON_FA_FILE_IMPORT " Show source locations", &m_asmShowSourceLocation ); + } ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); @@ -927,7 +930,7 @@ uint64_t SourceView::RenderSymbolAsmView( uint32_t iptotal, unordered_flat_mapAddLine( wpos + ImVec2( xoff + JumpSeparation * mjl + th2, th2 ), wpos + ImVec2( xoff + JumpSeparation * mjl + th2 + JumpArrow / 2, th2 ), col ); draw->AddLine( wpos + ImVec2( xoff + JumpSeparation * mjl + th2, th2 ), wpos + ImVec2( xoff + JumpSeparation * mjl + th2 + th4, th2 - th4 ), col );