diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2022-08-16 19:51:28 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2022-08-16 19:51:28 +0300 |
commit | 827bbeb442ca9cd3a6b388079ddda88eda3373b4 (patch) | |
tree | dc69fd27d64fba7e03cda836ae9123b9dbeb95fc /server/TracyView_Plots.cpp | |
parent | 4bf6a2b9d24d612a31ff5ddf35d65ae030fce08a (diff) |
Context menu hide for plots.
Diffstat (limited to 'server/TracyView_Plots.cpp')
-rw-r--r-- | server/TracyView_Plots.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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; |