mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Highlight selected/hovered lock.
This commit is contained in:
parent
d4fb6fde2b
commit
ea4f4ebb3a
@ -1695,6 +1695,7 @@ void View::DrawZones()
|
||||
{
|
||||
m_msgHighlight.Decay( nullptr );
|
||||
m_zoneSrcLocHighlight.Decay( 0 );
|
||||
m_lockHoverHighlight.Decay( InvalidId );
|
||||
|
||||
if( m_zvStart == m_zvEnd ) return;
|
||||
assert( m_zvStart < m_zvEnd );
|
||||
@ -2851,6 +2852,17 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
|
||||
|
||||
const auto offset = _offset + ostep * cnt;
|
||||
|
||||
if( m_lockInfoWindow == v.first )
|
||||
{
|
||||
draw->AddRectFilled( wpos + ImVec2( 0, offset ), wpos + ImVec2( w, offset + ty ), 0x2288DD88 );
|
||||
draw->AddRect( wpos + ImVec2( 0, offset ), wpos + ImVec2( w, offset + ty ), 0x4488DD88 );
|
||||
}
|
||||
else if( m_lockHoverHighlight == v.first )
|
||||
{
|
||||
draw->AddRectFilled( wpos + ImVec2( 0, offset ), wpos + ImVec2( w, offset + ty ), 0x228888DD );
|
||||
draw->AddRect( wpos + ImVec2( 0, offset ), wpos + ImVec2( w, offset + ty ), 0x448888DD );
|
||||
}
|
||||
|
||||
LockState state = LockState::Nothing;
|
||||
if( lockmap.type == LockType::Lockable )
|
||||
{
|
||||
@ -3266,12 +3278,16 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
|
||||
vbegin = next;
|
||||
}
|
||||
|
||||
if( drawn )
|
||||
if( drawn || m_lockInfoWindow == v.first )
|
||||
{
|
||||
char buf[1024];
|
||||
sprintf( buf, "%" PRIu32 ": %s", v.first, m_worker.GetString( srcloc.function ) );
|
||||
DrawTextContrast( draw, wpos + ImVec2( 0, offset ), 0xFF8888FF, buf );
|
||||
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, offset ), wpos + ImVec2( ty + ImGui::CalcTextSize( buf ).x, offset + ty ) ) )
|
||||
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, offset ), wpos + ImVec2( w, offset + ty ) ) )
|
||||
{
|
||||
m_lockHoverHighlight = v.first;
|
||||
|
||||
if( ImGui::IsMouseHoveringRect( wpos + ImVec2( 0, offset ), wpos + ImVec2( ty + ImGui::CalcTextSize( buf ).x, offset + ty ) ) )
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
switch( v.second.type )
|
||||
@ -3304,6 +3320,7 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
|
||||
m_lockInfoWindow = v.first;
|
||||
}
|
||||
}
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
|
@ -238,6 +238,7 @@ private:
|
||||
DecayValue<uint64_t> m_zoneSrcLocHighlight = 0;
|
||||
LockHighlight m_lockHighlight { -1 };
|
||||
DecayValue<const MessageData*> m_msgHighlight = nullptr;
|
||||
DecayValue<uint32_t> m_lockHoverHighlight = InvalidId;
|
||||
const MessageData* m_msgToFocus = nullptr;
|
||||
const GpuEvent* m_gpuInfoWindow = nullptr;
|
||||
const GpuEvent* m_gpuHighlight;
|
||||
|
Loading…
Reference in New Issue
Block a user