From 190eb491409d98a01edb53ceb22a6301022039db Mon Sep 17 00:00:00 2001 From: onewhl Date: Thu, 11 Aug 2016 12:44:16 +0300 Subject: [PATCH 1/2] redesign find and replace panel --- src/MainWindow.ui | 113 +++++++++++++++++++++++++++++++++------------- src/mainwin.cc | 13 +++--- 2 files changed, 88 insertions(+), 38 deletions(-) diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 0ed75748..063d071e 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -15,7 +15,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -30,7 +39,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -162,7 +180,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -245,7 +272,7 @@ 0 0 1118 - 22 + 19 @@ -402,7 +429,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -452,66 +488,72 @@ 0 - - - - - Find - - - - - Replace - - - - - Search string + + + + true - + - < + Find Previous - + - > + Find Next - + - Done + Cancel - Replacement string + + + + true - + + + + Find: + + + + Replace - + - All + Replace All + + + + + + + Replace with: @@ -528,7 +570,16 @@ - + + 0 + + + 0 + + + 0 + + 0 diff --git a/src/mainwin.cc b/src/mainwin.cc index ee07b5d6..1314e42d 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -458,9 +458,8 @@ MainWindow::MainWindow(const QString &filename) this->setColorScheme(cs); //find and replace panel - connect(this->findTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectFindType(int))); connect(this->findInputField, SIGNAL(textChanged(QString)), this, SLOT(findString(QString))); - connect(this->findInputField, SIGNAL(returnPressed()), this->nextButton, SLOT(animateClick())); + connect(this->findInputField, SIGNAL(returnPressed()), this->findNextButton, SLOT(animateClick())); find_panel->installEventFilter(this); if (QApplication::clipboard()->supportsFindBuffer()) { connect(this->findInputField, SIGNAL(textChanged(QString)), this, SLOT(updateFindBuffer(QString))); @@ -470,9 +469,9 @@ MainWindow::MainWindow(const QString &filename) this->findInputField->setText(QApplication::clipboard()->text(QClipboard::FindBuffer)); } - connect(this->prevButton, SIGNAL(clicked()), this, SLOT(findPrev())); - connect(this->nextButton, SIGNAL(clicked()), this, SLOT(findNext())); - connect(this->hideFindButton, SIGNAL(clicked()), find_panel, SLOT(hide())); + connect(this->findPrevButton, SIGNAL(clicked()), this, SLOT(findPrev())); + connect(this->findNextButton, SIGNAL(clicked()), this, SLOT(findNext())); + connect(this->cancelButton, SIGNAL(clicked()), find_panel, SLOT(hide())); connect(this->replaceButton, SIGNAL(clicked()), this, SLOT(replace())); connect(this->replaceAllButton, SIGNAL(clicked()), this, SLOT(replaceAll())); connect(this->replaceInputField, SIGNAL(returnPressed()), this->replaceButton, SLOT(animateClick())); @@ -1463,10 +1462,10 @@ void MainWindow::pasteViewportRotation() void MainWindow::find() { - findTypeComboBox->setCurrentIndex(0); replaceInputField->hide(); replaceButton->hide(); replaceAllButton->hide(); + replaceLabel->setVisible(false); find_panel->show(); if (!editor->selectedText().isEmpty()) { findInputField->setText(editor->selectedText()); @@ -1482,10 +1481,10 @@ void MainWindow::findString(QString textToFind) void MainWindow::findAndReplace() { - findTypeComboBox->setCurrentIndex(1); replaceInputField->show(); replaceButton->show(); replaceAllButton->show(); + replaceLabel->setVisible(true); find_panel->show(); if (!editor->selectedText().isEmpty()) { findInputField->setText(editor->selectedText()); From 0afe980c17e001c00247cc806e1a4708ce097ce2 Mon Sep 17 00:00:00 2001 From: Zarina Kurbatova Date: Thu, 11 Aug 2016 13:51:05 +0400 Subject: [PATCH 2/2] fix tab --- src/mainwin.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mainwin.cc b/src/mainwin.cc index 1314e42d..20d6153a 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -459,7 +459,7 @@ MainWindow::MainWindow(const QString &filename) //find and replace panel connect(this->findInputField, SIGNAL(textChanged(QString)), this, SLOT(findString(QString))); - connect(this->findInputField, SIGNAL(returnPressed()), this->findNextButton, SLOT(animateClick())); + connect(this->findInputField, SIGNAL(returnPressed()), this->findNextButton, SLOT(animateClick())); find_panel->installEventFilter(this); if (QApplication::clipboard()->supportsFindBuffer()) { connect(this->findInputField, SIGNAL(textChanged(QString)), this, SLOT(updateFindBuffer(QString))); @@ -469,9 +469,9 @@ MainWindow::MainWindow(const QString &filename) this->findInputField->setText(QApplication::clipboard()->text(QClipboard::FindBuffer)); } - connect(this->findPrevButton, SIGNAL(clicked()), this, SLOT(findPrev())); - connect(this->findNextButton, SIGNAL(clicked()), this, SLOT(findNext())); - connect(this->cancelButton, SIGNAL(clicked()), find_panel, SLOT(hide())); + connect(this->findPrevButton, SIGNAL(clicked()), this, SLOT(findPrev())); + connect(this->findNextButton, SIGNAL(clicked()), this, SLOT(findNext())); + connect(this->cancelButton, SIGNAL(clicked()), find_panel, SLOT(hide())); connect(this->replaceButton, SIGNAL(clicked()), this, SLOT(replace())); connect(this->replaceAllButton, SIGNAL(clicked()), this, SLOT(replaceAll())); connect(this->replaceInputField, SIGNAL(returnPressed()), this->replaceButton, SLOT(animateClick())); @@ -1465,7 +1465,7 @@ void MainWindow::find() replaceInputField->hide(); replaceButton->hide(); replaceAllButton->hide(); - replaceLabel->setVisible(false); + replaceLabel->setVisible(false); find_panel->show(); if (!editor->selectedText().isEmpty()) { findInputField->setText(editor->selectedText()); @@ -1484,7 +1484,7 @@ void MainWindow::findAndReplace() replaceInputField->show(); replaceButton->show(); replaceAllButton->show(); - replaceLabel->setVisible(true); + replaceLabel->setVisible(true); find_panel->show(); if (!editor->selectedText().isEmpty()) { findInputField->setText(editor->selectedText());