From fa8a0713348cfdc9cb15cc9d89dd960030760069 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 16 Aug 2022 18:39:55 +0200 Subject: [PATCH] Add context menu with hide option to threads on timeline. --- server/TracyView_Timeline.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/TracyView_Timeline.cpp b/server/TracyView_Timeline.cpp index 420803a2..43d5c550 100644 --- a/server/TracyView_Timeline.cpp +++ b/server/TracyView_Timeline.cpp @@ -603,6 +603,7 @@ void View::DrawTimeline() continue; } bool showFull = vis.showFull; + ImGui::PushID( &vis ); const auto yPos = AdjustThreadPosition( vis, wpos.y, offset ); const auto oldOffset = offset; @@ -962,12 +963,27 @@ void View::DrawTimeline() { ZoomToRange( first, last ); } + if( IsMouseClicked( 1 ) ) + { + ImGui::OpenPopup( "menuPopup" ); + } } } } + if( ImGui::BeginPopup( "menuPopup" ) ) + { + if( ImGui::MenuItem( ICON_FA_EYE_SLASH " Hide" ) ) + { + vis.visible = false; + ImGui::CloseCurrentPopup(); + } + ImGui::EndPopup(); + } + AdjustThreadHeight( Vis( v ), oldOffset, offset ); ImGui::PopClipRect(); + ImGui::PopID(); } m_lockHighlight = nextLockHighlight;