From be0a70a5c11c90c3002a9f512e79a16b0f4b00fc Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 20 Jun 2018 13:49:23 +0200 Subject: [PATCH] Highlight actively inspected callstack. --- server/TracyView.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index c8830e5d..3757fd3d 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4962,10 +4962,21 @@ void View::ListMemData( T ptr, T end, std::function DrawAdd } else { + bool hilite = m_callstackInfoWindow == v->csAlloc; + if( hilite ) + { + ImGui::PushStyleColor( ImGuiCol_Button, (ImVec4)ImColor::HSV( 0.f, 0.6f, 0.6f ) ); + ImGui::PushStyleColor( ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV( 0.f, 0.7f, 0.7f ) ); + ImGui::PushStyleColor( ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV( 0.f, 0.8f, 0.8f ) ); + } if( ImGui::SmallButton( "alloc" ) ) { m_callstackInfoWindow = v->csAlloc; } + if( hilite ) + { + ImGui::PopStyleColor( 3 ); + } if( ImGui::IsItemHovered() ) { CallstackTooltip( v->csAlloc ); @@ -4980,10 +4991,21 @@ void View::ListMemData( T ptr, T end, std::function DrawAdd } else { + bool hilite = m_callstackInfoWindow == v->csFree; + if( hilite ) + { + ImGui::PushStyleColor( ImGuiCol_Button, (ImVec4)ImColor::HSV( 0.f, 0.6f, 0.6f ) ); + ImGui::PushStyleColor( ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV( 0.f, 0.7f, 0.7f ) ); + ImGui::PushStyleColor( ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV( 0.f, 0.8f, 0.8f ) ); + } if( ImGui::SmallButton( "free" ) ) { m_callstackInfoWindow = v->csFree; } + if( hilite ) + { + ImGui::PopStyleColor( 3 ); + } if( ImGui::IsItemHovered() ) { CallstackTooltip( v->csFree );