mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 20:33:52 +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;
|
auto dx = ImGui::GetCursorPosX() - cx;
|
||||||
if( dx < targetLabelSize ) ImGui::SameLine( cx + targetLabelSize );
|
if( dx < targetLabelSize ) ImGui::SameLine( cx + targetLabelSize );
|
||||||
|
|
||||||
|
const auto firstTime = m_worker.GetFirstTime();
|
||||||
|
const auto lastTime = m_worker.GetLastTime();
|
||||||
cx = ImGui::GetCursorPosX();
|
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() )
|
if( ImGui::IsItemHovered() )
|
||||||
{
|
{
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
|
if( firstTime == 0 )
|
||||||
|
{
|
||||||
ImGui::Text( "Time span" );
|
ImGui::Text( "Time span" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TextFocused( "Total time span:", TimeToString( lastTime ) );
|
||||||
|
}
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
if( ImGui::IsItemClicked( 2 ) )
|
if( ImGui::IsItemClicked( 2 ) )
|
||||||
{
|
{
|
||||||
ZoomToRange( 0, m_worker.GetLastTime() );
|
ZoomToRange( firstTime, lastTime );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user