Display frame set tooltip.

This commit is contained in:
Bartosz Taudul 2018-08-05 13:33:18 +02:00
parent 44fecc4390
commit eb7064f13d

View File

@ -1055,6 +1055,7 @@ bool View::DrawZoneFrames( const FrameData& frames )
int64_t prev = -1;
int64_t prevEnd = -1;
bool tooltipDisplayed = false;
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 ) ) )
{
tooltipDisplayed = true;
ImGui::BeginTooltip();
ImGui::Text( "%s", GetFrameText( frames, i, ftime, m_worker.GetFrameOffset() ) );
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 );
}
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;
}