From df1a125fc0ea090a91e2dc2c7249c5c7fb7af75e Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 18 Dec 2018 16:56:19 +0100 Subject: [PATCH] Mirror find zone menu changes in compare menu. --- server/TracyView.cpp | 18 ++++++++++++------ server/TracyView.hpp | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 50b862f8..795d8877 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -5715,13 +5715,16 @@ void View::DrawCompare() return; } - ImGui::InputText( "", m_compare.pattern, 1024 ); - ImGui::SameLine(); + bool findClicked = false; + + ImGui::PushItemWidth( -0.01f ); + findClicked |= ImGui::InputText( "", m_compare.pattern, 1024, ImGuiInputTextFlags_EnterReturnsTrue ); + ImGui::PopItemWidth(); #ifdef TRACY_EXTENDED_FONT - const bool findClicked = ImGui::Button( ICON_FA_SEARCH " Find" ); + findClicked |= ImGui::Button( ICON_FA_SEARCH " Find" ); #else - const bool findClicked = ImGui::Button( "Find" ); + findClicked |= ImGui::Button( "Find" ); #endif ImGui::SameLine(); @@ -5733,6 +5736,9 @@ void View::DrawCompare() { m_compare.Reset(); } + ImGui::SameLine(); + + ImGui::Checkbox( "Ignore case", &m_compare.ignoreCase ); if( findClicked ) { @@ -8521,7 +8527,7 @@ void View::FindZones() void View::FindZonesCompare() { - m_compare.match[0] = m_worker.GetMatchingSourceLocation( m_compare.pattern, false ); + m_compare.match[0] = m_worker.GetMatchingSourceLocation( m_compare.pattern, m_compare.ignoreCase ); if( !m_compare.match[0].empty() ) { auto it = m_compare.match[0].begin(); @@ -8538,7 +8544,7 @@ void View::FindZonesCompare() } } - m_compare.match[1] = m_compare.second->GetMatchingSourceLocation( m_compare.pattern, false ); + m_compare.match[1] = m_compare.second->GetMatchingSourceLocation( m_compare.pattern, m_compare.ignoreCase ); if( !m_compare.match[1].empty() ) { auto it = m_compare.match[1].begin(); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 7cf9703e..e013adcb 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -366,6 +366,7 @@ private: struct { bool show = false; + bool ignoreCase = false; std::unique_ptr second; std::thread loadThread; int badVer = 0;