From ad95813ba0b7c9087b57a29ad405ca50a8acf00d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 14 Oct 2017 15:47:06 +0200 Subject: [PATCH] Message highlighting. --- server/TracyView.cpp | 12 +++++++++++- server/TracyView.hpp | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 99d6b93c..fe783581 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1625,6 +1625,8 @@ bool View::DrawZoneFrames() void View::DrawZones() { + m_msgHighlight = nullptr; + if( m_zvStart == m_zvEnd ) return; assert( m_zvStart < m_zvEnd ); @@ -1684,6 +1686,7 @@ void View::DrawZones() ImGui::Text( "%s", TimeToString( (*it)->time - m_frames[0] ) ); ImGui::Text( "%s", (*it)->txt ); ImGui::EndTooltip(); + m_msgHighlight = *it; } ++it; } @@ -2507,7 +2510,14 @@ void View::DrawMessages() { char tmp[4096]; sprintf( tmp, "%10s | %s", TimeToString( v->time - m_frames[0] ), v->txt ); - ImGui::Text( tmp ); + if( m_msgHighlight == v ) + { + ImGui::TextColored( ImVec4( 0xDD / 255.f, 0x22 / 255.f, 0x22 / 255.f, 1.f ), "%s", tmp ); + } + else + { + ImGui::Text( "%s", tmp ); + } if( ImGui::IsItemClicked() ) { m_pause = true; diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 3f79e8e8..ee3bc1a5 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -236,6 +236,7 @@ private: const Event* m_zoneInfoWindow; const Event* m_zoneHighlight; LockHighlight m_lockHighlight; + const MessageData* m_msgHighlight; bool m_showOptions; bool m_showMessages;