Show only active time span in on-demand mode.

This commit is contained in:
Bartosz Taudul 2023-03-03 22:12:33 +01:00
parent 1f94ab32df
commit 2f49caaa6e
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -909,16 +909,25 @@ bool View::DrawImpl()
auto dx = ImGui::GetCursorPosX() - cx;
if( dx < targetLabelSize ) ImGui::SameLine( cx + targetLabelSize );
const auto firstTime = m_worker.GetFirstTime();
const auto lastTime = m_worker.GetLastTime();
cx = ImGui::GetCursorPosX();
ImGui::Text( ICON_FA_DATABASE " %s", TimeToString( m_worker.GetLastTime() ) );
ImGui::Text( ICON_FA_DATABASE " %s", TimeToString( lastTime - firstTime ) );
if( ImGui::IsItemHovered() )
{
ImGui::BeginTooltip();
ImGui::Text( "Time span" );
if( firstTime == 0 )
{
ImGui::Text( "Time span" );
}
else
{
TextFocused( "Total time span:", TimeToString( lastTime ) );
}
ImGui::EndTooltip();
if( ImGui::IsItemClicked( 2 ) )
{
ZoomToRange( 0, m_worker.GetLastTime() );
ZoomToRange( firstTime, lastTime );
}
}
ImGui::SameLine();