1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-19 10:16:34 +01:00

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

Setting correct QWebPage::viewportSize() on creation.
Closes #663
This commit is contained in:
nowrep 2013-02-06 17:42:32 +01:00
parent 7c9d7fd25c
commit 60550fcbfb
2 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View File

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

View File

@ -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;
}