Mirror find zone menu changes in compare menu.

This commit is contained in:
Bartosz Taudul 2018-12-18 16:56:19 +01:00
parent a220f38fbd
commit df1a125fc0
2 changed files with 13 additions and 6 deletions

View File

@ -5715,13 +5715,16 @@ void View::DrawCompare()
return; return;
} }
ImGui::InputText( "", m_compare.pattern, 1024 ); bool findClicked = false;
ImGui::SameLine();
ImGui::PushItemWidth( -0.01f );
findClicked |= ImGui::InputText( "", m_compare.pattern, 1024, ImGuiInputTextFlags_EnterReturnsTrue );
ImGui::PopItemWidth();
#ifdef TRACY_EXTENDED_FONT #ifdef TRACY_EXTENDED_FONT
const bool findClicked = ImGui::Button( ICON_FA_SEARCH " Find" ); findClicked |= ImGui::Button( ICON_FA_SEARCH " Find" );
#else #else
const bool findClicked = ImGui::Button( "Find" ); findClicked |= ImGui::Button( "Find" );
#endif #endif
ImGui::SameLine(); ImGui::SameLine();
@ -5733,6 +5736,9 @@ void View::DrawCompare()
{ {
m_compare.Reset(); m_compare.Reset();
} }
ImGui::SameLine();
ImGui::Checkbox( "Ignore case", &m_compare.ignoreCase );
if( findClicked ) if( findClicked )
{ {
@ -8521,7 +8527,7 @@ void View::FindZones()
void View::FindZonesCompare() 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() ) if( !m_compare.match[0].empty() )
{ {
auto it = m_compare.match[0].begin(); 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() ) if( !m_compare.match[1].empty() )
{ {
auto it = m_compare.match[1].begin(); auto it = m_compare.match[1].begin();

View File

@ -366,6 +366,7 @@ private:
struct { struct {
bool show = false; bool show = false;
bool ignoreCase = false;
std::unique_ptr<Worker> second; std::unique_ptr<Worker> second;
std::thread loadThread; std::thread loadThread;
int badVer = 0; int badVer = 0;