mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 14:54:34 +00:00
Display frame set tooltip.
This commit is contained in:
parent
44fecc4390
commit
eb7064f13d
@ -1055,6 +1055,7 @@ bool View::DrawZoneFrames( const FrameData& frames )
|
|||||||
|
|
||||||
int64_t prev = -1;
|
int64_t prev = -1;
|
||||||
int64_t prevEnd = -1;
|
int64_t prevEnd = -1;
|
||||||
|
bool tooltipDisplayed = false;
|
||||||
|
|
||||||
for( int i = zrange.first; i < zrange.second; i++ )
|
for( int i = zrange.first; i < zrange.second; i++ )
|
||||||
{
|
{
|
||||||
@ -1065,6 +1066,8 @@ bool View::DrawZoneFrames( const FrameData& frames )
|
|||||||
|
|
||||||
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns, 0 ), wpos + ImVec2( ( fend - m_zvStart ) * pxns, ty ) ) )
|
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( ( fbegin - m_zvStart ) * pxns, 0 ), wpos + ImVec2( ( fend - m_zvStart ) * pxns, ty ) ) )
|
||||||
{
|
{
|
||||||
|
tooltipDisplayed = true;
|
||||||
|
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text( "%s", GetFrameText( frames, i, ftime, m_worker.GetFrameOffset() ) );
|
ImGui::Text( "%s", GetFrameText( frames, i, ftime, m_worker.GetFrameOffset() ) );
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
@ -1168,6 +1171,15 @@ bool View::DrawZoneFrames( const FrameData& frames )
|
|||||||
draw->AddLine( wpos + ImVec2( ( fend - m_zvStart ) * pxns, 0 ), wpos + ImVec2( ( fend - m_zvStart ) * pxns, wh ), 0x22FFFFFF );
|
draw->AddLine( wpos + ImVec2( ( fend - m_zvStart ) * pxns, 0 ), wpos + ImVec2( ( fend - m_zvStart ) * pxns, wh ), 0x22FFFFFF );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( hover && !tooltipDisplayed )
|
||||||
|
{
|
||||||
|
ImGui::BeginTooltip();
|
||||||
|
ImGui::TextDisabled( "Frame set:" );
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Text( "%s", frames.name == 0 ? "Frames" : m_worker.GetString( frames.name ) );
|
||||||
|
ImGui::EndTooltip();
|
||||||
|
}
|
||||||
|
|
||||||
return hover;
|
return hover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user