summaryrefslogtreecommitdiffstats
path: root/qt-ui/usermanual.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-06-30 17:45:52 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-30 16:04:24 -0700
commit927bc5d60135f97f7241fbe9f77d745c6fceb517 (patch)
treefb9612a8b94803ed2d0685275ef141e9eee9edab /qt-ui/usermanual.h
parent4c7ea24921ddf44b4250cf65209f96a4ff121620 (diff)
downloadsubsurface-927bc5d60135f97f7241fbe9f77d745c6fceb517.tar.gz
Fixed SearchBar layout and icons
This is almost a rewrite of the Search function on the WebView the old code had a few uneeded things, mostly being a subclass of QMainWindow instead of the QWebView - this makes the code use a tiny bit less ram. The SearchBox was also moved to an own class ( we can use it later to filter the contents of the DiveList for instance ) and a forced use of the pixmaps for the Mac and Windows platform was added. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/usermanual.h')
-rw-r--r--qt-ui/usermanual.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/qt-ui/usermanual.h b/qt-ui/usermanual.h
index de8770eba..7cd10c185 100644
--- a/qt-ui/usermanual.h
+++ b/qt-ui/usermanual.h
@@ -1,31 +1,42 @@
#ifndef USERMANUAL_H
#define USERMANUAL_H
-#include <QMainWindow>
-#include <QWebPage>
+#include <QWebView>
-namespace Ui {
- class UserManual;
-}
+#include "ui_searchbar.h"
-class UserManual : public QMainWindow {
+class SearchBar : public QWidget{
+ Q_OBJECT
+public:
+ SearchBar(QWidget *parent = 0);
+signals:
+ void searchTextChanged(const QString& s);
+ void searchNext();
+ void searchPrev();
+protected:
+ void setVisible(bool visible);
+private slots:
+ void enableButtons(const QString& s);
+private:
+ Ui::SearchBar ui;
+};
+
+class UserManual : public QWebView {
Q_OBJECT
public:
explicit UserManual(QWidget *parent = 0);
~UserManual();
-
private
slots:
- void showSearchPanel();
- void hideSearchPanel();
- void searchTextChanged(QString);
+ void searchTextChanged(const QString& s);
void searchNext();
void searchPrev();
void linkClickedSlot(QUrl url);
private:
- Ui::UserManual *ui;
+ SearchBar *searchBar;
+ QString mLastText;
void search(QString, QWebPage::FindFlags);
};
#endif // USERMANUAL_H