Improve lock tooltips.

This commit is contained in:
Bartosz Taudul 2018-06-29 18:49:47 +02:00
parent a918d9a401
commit bcd2fc027d

View File

@ -2087,7 +2087,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
if( condensed > 1 ) if( condensed > 1 )
{ {
ImGui::BeginTooltip(); ImGui::BeginTooltip();
ImGui::Text( "Multiple lock events (%s)", RealToString( condensed, true ) ); TextFocused( "Multiple lock events:", RealToString( condensed, true ) );
ImGui::EndTooltip(); ImGui::EndTooltip();
} }
else else
@ -2133,7 +2133,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
ImGui::Text( "Lock #%" PRIu32 ": %s", v.first, m_worker.GetString( srcloc.function ) ); ImGui::Text( "Lock #%" PRIu32 ": %s", v.first, m_worker.GetString( srcloc.function ) );
ImGui::Separator(); ImGui::Separator();
ImGui::Text( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line ); ImGui::Text( "%s:%i", m_worker.GetString( srcloc.file ), srcloc.line );
ImGui::Text( "Time: %s", TimeToString( t1 - t0 ) ); TextFocused( "Time:", TimeToString( t1 - t0 ) );
ImGui::Separator(); ImGui::Separator();
uint32_t markloc = 0; uint32_t markloc = 0;
@ -2398,10 +2398,10 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
switch( v.second.type ) switch( v.second.type )
{ {
case LockType::Lockable: case LockType::Lockable:
ImGui::Text( "Type: lockable" ); TextFocused( "Type:", "lockable" );
break; break;
case LockType::SharedLockable: case LockType::SharedLockable:
ImGui::Text( "Type: shared lockable" ); TextFocused( "Type:", "shared lockable" );
break; break;
default: default:
assert( false ); assert( false );
@ -2416,7 +2416,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
} }
ImGui::Unindent( ty ); ImGui::Unindent( ty );
ImGui::Separator(); ImGui::Separator();
ImGui::Text( "Lock events: %s", RealToString( v.second.timeline.size(), true ) ); TextFocused( "Lock events:", RealToString( v.second.timeline.size(), true ) );
ImGui::EndTooltip(); ImGui::EndTooltip();
} }
cnt++; cnt++;