Change Find/Replace dialog to have Find Next/Find Previous buttons

* Enter and shift-enter in the find text go forwarwd and backwards respectively.
* This replaces the previous system of selecting a direction explicitly and only
  ever going in that direction when finding.
This commit is contained in:
baldurk
2020-02-25 14:55:21 +00:00
parent 8102a784bf
commit a2b437b903
4 changed files with 90 additions and 95 deletions
+4 -1
View File
@@ -4098,7 +4098,7 @@ void ShaderViewer::find(bool down)
FindReplace::SearchContext context = m_FindReplace->context();
QString findHash = QFormatStr("%1%2%3").arg(find).arg(flags).arg((int)context);
QString findHash = QFormatStr("%1%2%3%4").arg(find).arg(flags).arg((int)context).arg(down);
if(findHash != m_FindState.hash)
{
@@ -4106,6 +4106,9 @@ void ShaderViewer::find(bool down)
m_FindState.start = 0;
m_FindState.end = cur->length();
m_FindState.offset = cur->currentPos();
if(down && cur->selectionStart() == m_FindState.offset &&
cur->selectionEnd() - m_FindState.offset == find.length())
m_FindState.offset += find.length();
}
int start = m_FindState.start + m_FindState.offset;