From d13fc2413f0487b4b906aca6da2426a673880aca Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 22 Jun 2018 02:24:36 +0200 Subject: [PATCH] Highlight callstack button in zone info windows. --- server/TracyView.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 3965cec2..54003e9d 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2781,10 +2781,21 @@ void View::DrawZoneInfoWindow() if( ev.callstack != 0 ) { ImGui::SameLine(); + bool hilite = m_callstackInfoWindow == ev.callstack; + 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::Button( "Callstack" ) ) { m_callstackInfoWindow = ev.callstack; } + if( hilite ) + { + ImGui::PopStyleColor( 3 ); + } } if( !m_zoneInfoStack.empty() ) { @@ -3063,10 +3074,21 @@ void View::DrawGpuInfoWindow() if( ev.callstack != 0 ) { ImGui::SameLine(); + bool hilite = m_callstackInfoWindow == ev.callstack; + 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::Button( "Callstack" ) ) { m_callstackInfoWindow = ev.callstack; } + if( hilite ) + { + ImGui::PopStyleColor( 3 ); + } } if( !m_gpuInfoStack.empty() ) {