Highlight actively inspected callstack.

This commit is contained in:
Bartosz Taudul 2018-06-20 13:49:23 +02:00
parent 15ff98b64a
commit be0a70a5c1

View File

@ -4962,10 +4962,21 @@ void View::ListMemData( T ptr, T end, std::function<const MemEvent*(T&)> 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<const MemEvent*(T&)> 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 );