mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
WebScrollBarManager: Fix height of vertical scrollbar when horizontal is visible
Also fix warnings in console when trying to access null document.documentElement
This commit is contained in:
parent
899622e623
commit
e656e92eaf
@ -136,8 +136,8 @@ void WebScrollBarManager::addWebView(WebView *view)
|
|||||||
|
|
||||||
connect(view->page(), &WebPage::contentsSizeChanged, this, [=]() {
|
connect(view->page(), &WebPage::contentsSizeChanged, this, [=]() {
|
||||||
const QString source = QL1S("var out = {"
|
const QString source = QL1S("var out = {"
|
||||||
"vertical: window.innerWidth > document.documentElement.clientWidth,"
|
"vertical: document.documentElement && window.innerWidth > document.documentElement.clientWidth,"
|
||||||
"horizontal: window.innerHeight > document.documentElement.clientHeight"
|
"horizontal: document.documentElement && window.innerHeight > document.documentElement.clientHeight"
|
||||||
"};out;");
|
"};out;");
|
||||||
|
|
||||||
QPointer<WebView> p(view);
|
QPointer<WebView> p(view);
|
||||||
@ -214,7 +214,8 @@ QSize WebScrollBarManager::viewportSize(WebView *view, int thickness) const
|
|||||||
|
|
||||||
if (data->vscrollbarVisible) {
|
if (data->vscrollbarVisible) {
|
||||||
viewport.setWidth(viewport.width() - thickness);
|
viewport.setWidth(viewport.width() - thickness);
|
||||||
} else if (data->hscrollbarVisible) {
|
}
|
||||||
|
if (data->hscrollbarVisible) {
|
||||||
viewport.setHeight(viewport.height() - thickness);
|
viewport.setHeight(viewport.height() - thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user