1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Added wrapping for backward finding

This commit is contained in:
nowrep 2011-03-19 13:14:43 +01:00
parent 2449573c13
commit ea6a0078e0
2 changed files with 4 additions and 3 deletions

View File

@ -52,7 +52,8 @@ SourceViewerSearch::SourceViewerSearch(SourceViewer* parent) :
ui->lineEdit->setFocus();
startAnimation();
connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(hide()));
connect(ui->lineEdit, SIGNAL(cursorPositionChanged(int,int)), this, SLOT(next()));
connect(ui->lineEdit, SIGNAL(textEdited(QString)), this, SLOT(next()));
connect(ui->lineEdit, SIGNAL(returnPressed()), this, SLOT(next()));
connect(ui->next, SIGNAL(clicked()), this, SLOT(next()));
connect(ui->previous, SIGNAL(clicked()), this, SLOT(previous()));
}
@ -97,7 +98,7 @@ bool SourceViewerSearch::find(QTextDocument::FindFlags flags)
if (!m_sourceViewer->sourceEdit()->find(string, flags)) {
QTextCursor cursor = m_sourceViewer->sourceEdit()->textCursor();
m_sourceViewer->sourceEdit()->moveCursor(QTextCursor::Start);
m_sourceViewer->sourceEdit()->moveCursor( (flags == QTextDocument::FindBackward ) ? QTextCursor::End : QTextCursor::Start );
if (!m_sourceViewer->sourceEdit()->find(string,flags)) {
cursor.clearSelection();
m_sourceViewer->sourceEdit()->setTextCursor(cursor);

View File

@ -32,7 +32,7 @@
<string/>
</property>
<property name="shortcut">
<string>Esc</string>
<string notr="true">Esc</string>
</property>
<property name="autoRaise">
<bool>true</bool>