summaryrefslogtreecommitdiffstats
path: root/qt-ui/usermanual.cpp
diff options
context:
space:
mode:
authorGravatar Sergey Starosek <sergey.starosek@gmail.com>2014-01-09 20:29:33 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-10 16:12:44 +0700
commit7e7a1d29ad7800b6f3b763f9d230865cd1df441a (patch)
tree910fdababf8fbb2379fd6ee39f175dc21490f556 /qt-ui/usermanual.cpp
parent8ded16fd1b1bda46ff20eadd9bd596c45afc96d6 (diff)
downloadsubsurface-7e7a1d29ad7800b6f3b763f9d230865cd1df441a.tar.gz
User manual: overlay search panel
Make search panel floating so that web view does not resize. This commit also addresses following issues: - search now wraps around document - application icon and window title are now back Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/usermanual.cpp')
-rw-r--r--qt-ui/usermanual.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-ui/usermanual.cpp b/qt-ui/usermanual.cpp
index 56f0fe1c3..cb9b4da50 100644
--- a/qt-ui/usermanual.cpp
+++ b/qt-ui/usermanual.cpp
@@ -6,7 +6,7 @@
#include "../helpers.h"
UserManual::UserManual(QWidget *parent) :
- QWidget(parent),
+ QMainWindow(parent),
ui(new Ui::UserManual)
{
ui->setupUi(this);
@@ -21,12 +21,12 @@ UserManual::UserManual(QWidget *parent) :
actionHideSearch->setShortcutContext(Qt::WindowShortcut);
addAction(actionHideSearch);
+ setWindowTitle(tr("User Manual"));
+
ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
QString searchPath = getSubsurfaceDataPath("Documentation");
if (searchPath != "") {
QUrl url(searchPath.append("/user-manual.html"));
- ui->webView->setWindowTitle(tr("User Manual"));
- ui->webView->setWindowIcon(QIcon(":/subsurface-icon"));
ui->webView->setUrl(url);
} else {
ui->webView->setHtml(tr("Cannot find the Subsurface manual"));
@@ -56,7 +56,7 @@ void UserManual::hideSearchPanel()
void UserManual::search(QString text, QWebPage::FindFlags flags = 0)
{
- if (ui->webView->findText(text, flags) || text.length() == 0) {
+ if (ui->webView->findText(text, QWebPage::FindWrapsAroundDocument|flags) || text.length() == 0) {
ui->searchEdit->setStyleSheet("");
} else {
ui->searchEdit->setStyleSheet("QLineEdit{background: red;}");