mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Show only active time span in on-demand mode.
This commit is contained in:
parent
1f94ab32df
commit
2f49caaa6e
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user