1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Improve readability of find zone menu.

This commit is contained in:
Bartosz Taudul 2018-06-29 18:33:01 +02:00
parent 8f4b09edc3
commit 91dd8f5d52

View File

@ -3600,7 +3600,9 @@ void View::DrawFindZone()
ImGui::EndTooltip(); ImGui::EndTooltip();
} }
ImGui::Text( "Time range: %s - %s (%s)", TimeToString( tmin ), TimeToString( tmax ), TimeToString( tmax - tmin ) ); ImGui::TextDisabled( "Time range:" );
ImGui::SameLine();
ImGui::Text( "%s - %s (%s)", TimeToString( tmin ), TimeToString( tmax ), TimeToString( tmax - tmin ) );
const auto dt = double( tmax - tmin ); const auto dt = double( tmax - tmin );
const auto selThread = m_findZone.selThread; const auto selThread = m_findZone.selThread;
@ -3813,21 +3815,23 @@ void View::DrawFindZone()
} }
} }
ImGui::Text( "Total time: %s", TimeToString( timeTotal ) ); TextFocused( "Total time:", TimeToString( timeTotal ) );
ImGui::SameLine(); ImGui::SameLine();
ImGui::Spacing(); ImGui::Spacing();
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text( "Max counts: %s", cumulateTime ? TimeToString( maxVal ) : RealToString( maxVal, true ) ); TextFocused( "Max counts:", cumulateTime ? TimeToString( maxVal ) : RealToString( maxVal, true ) );
ImGui::TextDisabled( "Selection range:" );
ImGui::SameLine();
if( m_findZone.highlight.active ) if( m_findZone.highlight.active )
{ {
const auto s = std::min( m_findZone.highlight.start, m_findZone.highlight.end ); const auto s = std::min( m_findZone.highlight.start, m_findZone.highlight.end );
const auto e = std::max( m_findZone.highlight.start, m_findZone.highlight.end ); const auto e = std::max( m_findZone.highlight.start, m_findZone.highlight.end );
ImGui::Text( "Selection range: %s - %s (%s)", TimeToString( s ), TimeToString( e ), TimeToString( e - s ) ); ImGui::Text( "%s - %s (%s)", TimeToString( s ), TimeToString( e ), TimeToString( e - s ) );
} }
else else
{ {
ImGui::Text( "Selection range: none" ); ImGui::Text( "none" );
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextDisabled( "(?)" ); ImGui::TextDisabled( "(?)" );
@ -3839,19 +3843,19 @@ void View::DrawFindZone()
} }
if( m_findZone.highlight.active ) if( m_findZone.highlight.active )
{ {
ImGui::Text( "Selection time: %s", TimeToString( selectionTime ) ); TextFocused( "Selection time:", TimeToString( selectionTime ) );
} }
else else
{ {
ImGui::Text( "Selection time: none" ); TextFocused( "Selection time:", "none" );
} }
if( selThread != m_findZone.Unselected ) if( selThread != m_findZone.Unselected )
{ {
ImGui::Text( "Zone group time: %s", TimeToString( selBinTime ) ); TextFocused( "Zone group time:", TimeToString( selBinTime ) );
} }
else else
{ {
ImGui::Text( "Zone group time: none" ); TextFocused( "Zone group time:", "none" );
} }
const auto Height = 200 * ImGui::GetTextLineHeight() / 15.f; const auto Height = 200 * ImGui::GetTextLineHeight() / 15.f;
@ -4028,11 +4032,15 @@ void View::DrawFindZone()
} }
ImGui::BeginTooltip(); ImGui::BeginTooltip();
ImGui::Text( "Time range: %s - %s", TimeToString( t0 ), TimeToString( t1 ) ); ImGui::TextDisabled( "Time range:" );
ImGui::Text( "Count: %" PRIu64, bins[bin] ); ImGui::SameLine();
ImGui::Text( "Time spent in bin: %s", TimeToString( binTime[bin] ) ); ImGui::Text( "%s - %s", TimeToString( t0 ), TimeToString( t1 ) );
ImGui::Text( "Time spent in the left bins: %s", TimeToString( tBefore ) ); ImGui::TextDisabled( "Count:" );
ImGui::Text( "Time spent in the right bins: %s", TimeToString( tAfter ) ); ImGui::SameLine();
ImGui::Text( "%" PRIu64, bins[bin] );
TextFocused( "Time spent in bin:", TimeToString( binTime[bin] ) );
TextFocused( "Time spent in the left bins:", TimeToString( tBefore ) );
TextFocused( "Time spent in the right bins:", TimeToString( tAfter ) );
ImGui::EndTooltip(); ImGui::EndTooltip();
if( ImGui::IsMouseClicked( 1 ) ) if( ImGui::IsMouseClicked( 1 ) )