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

Highlight selected zone.

This commit is contained in:
Bartosz Taudul 2017-09-29 21:57:00 +02:00
parent c5f6ca9656
commit b386e51edc
2 changed files with 15 additions and 1 deletions

View File

@ -1188,7 +1188,7 @@ int View::DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, con
const auto px0 = std::max( pr0, -10.0 );
const auto px1 = std::min( pr1, double( w + 10 ) );
draw->AddRectFilled( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), color, 2.f );
draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), 0xAAAAAAAA, 2.f );
draw->AddRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ), GetZoneHighlight( ev ), 2.f );
if( dsz * dmul >= MinVisSize )
{
draw->AddRectFilled( wpos + ImVec2( pr0, offset ), wpos + ImVec2( std::min( pr0+dsz*dmul, pr1 ), offset + tsz.y ), 0x882222DD, 2.f );
@ -1285,4 +1285,16 @@ void View::DrawZoneInfoWindow()
if( !show ) m_zoneInfoWindow = nullptr;
}
uint32_t View::GetZoneHighlight( const Event& ev )
{
if( m_zoneInfoWindow == &ev )
{
return 0xFF44DD44;
}
else
{
return 0xAAAAAAAA;
}
}
}

View File

@ -87,6 +87,8 @@ private:
int DrawZoneLevel( const Vector<Event*>& vec, bool hover, double pxns, const ImVec2& wpos, int offset, int depth );
void DrawZoneInfoWindow();
uint32_t GetZoneHighlight( const Event& ev );
std::string m_addr;
Socket m_sock;