1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

WebScrollBar: HighDPI fixes

This commit is contained in:
David Rosca 2016-12-27 13:41:12 +01:00
parent f651b42e23
commit 0a0eb2a038
2 changed files with 4 additions and 2 deletions

View File

@ -46,13 +46,13 @@ void WebScrollBar::updateValues(const QSize &viewport)
int newValue;
if (orientation() == Qt::Vertical) {
setFixedHeight(viewport.height());
setFixedHeight(m_view->height() - (m_view->height() - viewport.height()) * devicePixelRatioF());
move(m_view->width() - width(), 0);
setPageStep(viewport.height());
setMaximum(std::max(0, m_view->page()->contentsSize().toSize().height() - viewport.height()));
newValue = m_view->page()->scrollPosition().toPoint().y();
} else {
setFixedWidth(viewport.width());
setFixedWidth(m_view->width() - (m_view->width() - viewport.width()) * devicePixelRatioF());
move(0, m_view->height() - height());
setPageStep(viewport.width());
setMaximum(std::max(0, m_view->page()->contentsSize().toSize().width() - viewport.width()));

View File

@ -184,6 +184,8 @@ QSize WebScrollBarManager::viewportSize(WebView *view, int thickness) const
QSize viewport = view->size();
const QSize content = view->page()->contentsSize().toSize();
thickness /= view->devicePixelRatioF();
// Check both axis
if (content.width() - viewport.width() > 0) {
viewport.setHeight(viewport.height() - thickness);