mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
8ded16fd1b
commit
7e7a1d29ad
3 changed files with 127 additions and 146 deletions
|
@ -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;}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue