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:
parent
f651b42e23
commit
0a0eb2a038
|
@ -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()));
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user