Fixed scrolling to anchor(#) links in background tabs.

Setting correct QWebPage::viewportSize() on creation.
Closes #663
remotes/origin/falkon
nowrep 13 years ago
parent 7c9d7fd25c
commit 60550fcbfb
  1. 1
      .gitignore
  2. 11
      src/lib/webview/tabwidget.cpp

1
.gitignore vendored

@ -32,3 +32,4 @@ tests/modeltest
*.embed.manifest
bin/autotests
.clang_complete
.tx/

@ -347,6 +347,17 @@ int TabWidget::addView(QNetworkRequest req, const QString &title, const Qz::NewT
m_isClosingToLastTabIndex = true;
}
if (openFlags & Qz::NT_NotSelectedTab) {
WebTab* currentWebTab = weTab();
// Workarounding invalid QWebPage::viewportSize() until QWebView is shown
// Fixes invalid scrolling to anchor(#) links
if (currentWebTab && currentWebTab->view()) {
TabbedWebView* currentView = currentWebTab->view();
webView->resize(currentView->size());
webView->page()->setViewportSize(currentView->page()->viewportSize());
}
}
return index;
}

Loading…
Cancel
Save