diff --git a/server/TracyView_Plots.cpp b/server/TracyView_Plots.cpp index 03202ab5..f656b268 100644 --- a/server/TracyView_Plots.cpp +++ b/server/TracyView_Plots.cpp @@ -98,6 +98,7 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl } if( v->data.empty() ) continue; bool& showFull = vis.showFull; + ImGui::PushID( &vis ); float txtx = 0; const auto yPos = AdjustThreadPosition( vis, wpos.y, offset ); @@ -162,6 +163,10 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl { ZoomToRange( first, last ); } + if( IsMouseClicked( 1 ) ) + { + ImGui::OpenPopup( "menuPopup" ); + } } } @@ -409,9 +414,21 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl offset += PlotHeight; } } + + if( ImGui::BeginPopup( "menuPopup" ) ) + { + if( ImGui::MenuItem( ICON_FA_EYE_SLASH " Hide" ) ) + { + vis.visible = false; + ImGui::CloseCurrentPopup(); + } + ImGui::EndPopup(); + } + offset += 0.2 * ty; AdjustThreadHeight( vis, oldOffset, offset ); ImGui::PopClipRect(); + ImGui::PopID(); } return offset;