1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Context menu hide for plots.

This commit is contained in:
Bartosz Taudul 2022-08-16 18:51:28 +02:00
parent 4bf6a2b9d2
commit 827bbeb442
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -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;