aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt16
-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
5 files changed, 26 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a0e6b9d..fc1cc4c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,23 +65,25 @@ set(SourceCode
"src/singleapplication.h"
"src/browser.cpp"
"src/browser.h"
+ "data/resources.qrc"
# main window
- # todo: move all to src/mainwindow
src/mainwindow/mainwindow.cpp
src/mainwindow/mainwindow.h
src/mainwindow/mainwindow.ui
src/mainwindow/widgets/loadingbar.cpp
src/mainwindow/widgets/loadingbar.h
+ src/mainwindow/widgets/navigationbar.cpp
+ src/mainwindow/widgets/navigationbar.h
+ src/mainwindow/widgets/searchform.cpp
+ src/mainwindow/widgets/searchform.h
+ src/mainwindow/widgets/searchform.ui
+
+ # todo: move all to src/mainwindow
"src/widgets/mainwindowmenubar.cpp"
"src/widgets/mainwindowmenubar.h"
"src/widgets/mainwindowtabbar.cpp"
"src/widgets/mainwindowtabbar.h"
- # todo: move to src/mainwindow
- "src/forms/searchform.cpp"
- "src/forms/searchform.h"
- "src/forms/searchform.ui"
- "data/resources.qrc"
# webengine
src/webengine/cookieinterceptor.cpp
@@ -106,7 +108,7 @@ set(SourceCode
# plugin interfaces
plugins/interfaces.h
- src/mainwindow/widgets/navigationbar.cpp src/mainwindow/widgets/navigationbar.h)
+ )
add_executable(poi ${SourceCode})
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/>