aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow/mainwindow.cpp2
-rw-r--r--src/mainwindow/widgets/searchform.cpp (renamed from src/forms/searchform.cpp)9
-rw-r--r--src/mainwindow/widgets/searchform.h (renamed from src/forms/searchform.h)4
-rw-r--r--src/mainwindow/widgets/searchform.ui (renamed from src/forms/searchform.ui)11
4 files changed, 17 insertions, 9 deletions
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index 94e9bce..a45c89e 100644
--- a/src/mainwindow/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -8,7 +8,7 @@
#include "mainwindow.h"
#include "forms/aboutdialog.h"
-#include "forms/searchform.h"
+#include "src/mainwindow/widgets/searchform.h"
#include "ui_mainwindow.h"
#include "widgets/mainwindowmenubar.h"
#include <QDockWidget>
diff --git a/src/forms/searchform.cpp b/src/mainwindow/widgets/searchform.cpp
index 03fd24f..08d4470 100644
--- a/src/forms/searchform.cpp
+++ b/src/mainwindow/widgets/searchform.cpp
@@ -10,8 +10,6 @@
#include "src/mainwindow/mainwindow.h"
#include "ui_searchform.h"
-#include <settings/configuration.h>
-
SearchForm::SearchForm(MainWindow *parentWindow, QWidget *parent)
: QWidget(parent)
, ui(new Ui::SearchForm)
@@ -21,9 +19,10 @@ SearchForm::SearchForm(MainWindow *parentWindow, QWidget *parent)
ui->setupUi(this);
ui->lineEdit->setPlaceholderText(tr("Search"));
ui->lineEdit->setClearButtonEnabled(true);
+ ui->result_label->setVisible(false);
// show/hide action
- QAction *toggleSearchBox = new QAction(this);
+ auto *toggleSearchBox = new QAction(this);
toggleSearchBox->setShortcut(QKeySequence(QString::fromStdString(parentWindow->m_config->value<std::string>("browser.shortcuts.toggleSearchBox").value())));
connect(toggleSearchBox, &QAction::triggered, this, [this, parentWindow]() {
if(isVisible()) {
@@ -41,7 +40,9 @@ SearchForm::SearchForm(MainWindow *parentWindow, QWidget *parent)
QWebEnginePage::FindFlags searchFlags;
searchFlags.setFlag(QWebEnginePage::FindCaseSensitively, ui->caseSensitivity_checkBox->isChecked());
searchFlags.setFlag(QWebEnginePage::FindBackward, ui->reverseSearch_checkBox->isChecked());
- parentWindow->m_currentView->findText(ui->lineEdit->text(), searchFlags);
+ parentWindow->m_currentView->findText(ui->lineEdit->text(), searchFlags, [this](bool found) {
+ ui->result_label->setVisible(!found);
+ });
});
}
diff --git a/src/forms/searchform.h b/src/mainwindow/widgets/searchform.h
index da25474..94cc2a9 100644
--- a/src/forms/searchform.h
+++ b/src/mainwindow/widgets/searchform.h
@@ -23,10 +23,10 @@ class SearchForm : public QWidget
public:
explicit SearchForm(MainWindow *parentWindow, QWidget *parent = nullptr);
- ~SearchForm();
+ ~SearchForm() override;
protected:
- void focusInEvent(QFocusEvent *e);
+ void focusInEvent(QFocusEvent *e) override;
private:
Ui::SearchForm *ui;
diff --git a/src/forms/searchform.ui b/src/mainwindow/widgets/searchform.ui
index 2b0c551..9d1d108 100644
--- a/src/forms/searchform.ui
+++ b/src/mainwindow/widgets/searchform.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>550</width>
- <height>26</height>
+ <width>600</width>
+ <height>32</height>
</rect>
</property>
<property name="windowTitle">
@@ -37,6 +37,13 @@
</property>
</widget>
</item>
+ <item>
+ <widget class="QLabel" name="result_label">
+ <property name="text">
+ <string>No Results found</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<resources/>