mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-24 04:36:34 +01:00
Fixed regression from last commit when page thumbnail could be rendered
with scrollbars.
This commit is contained in:
parent
a34057d1ea
commit
48b7aed86b
@ -47,7 +47,7 @@ private:
|
||||
QPoint m_position;
|
||||
|
||||
QWeakPointer<DesktopNotification> m_desktopNotif;
|
||||
unsigned int m_uint;
|
||||
quint32 m_uint;
|
||||
};
|
||||
|
||||
#endif // DESKTOPNOTIFICATIONSFACTORY_H
|
||||
|
@ -257,15 +257,14 @@ QPixmap WebTab::renderTabPreview()
|
||||
const int previewHeight = 150;
|
||||
const int verticalScrollBarWidth = page->mainFrame()->scrollBarGeometry(Qt::Vertical).width();
|
||||
const int horizontalScrollBarWidth = page->mainFrame()->scrollBarGeometry(Qt::Horizontal).height();
|
||||
const int pageWidth = qMin(page->mainFrame()->contentsSize().width(), 1280);
|
||||
const int pageHeight = (pageWidth / 23 * 15);
|
||||
const qreal scalingFactor = 2 * static_cast<qreal>(previewWidth) / pageWidth;
|
||||
|
||||
int renderWidth = qMin(page->mainFrame()->contentsSize().width(), 1280) - verticalScrollBarWidth;
|
||||
int renderHeight = (renderWidth / 23 * 15) - horizontalScrollBarWidth;
|
||||
qreal scalingFactor = 2 * static_cast<qreal>(previewWidth) / renderWidth;
|
||||
page->setViewportSize(QSize(pageWidth, pageHeight));
|
||||
|
||||
page->setViewportSize(QSize(renderWidth, renderHeight));
|
||||
|
||||
QPixmap pageImage(2 * previewWidth, 2 * previewHeight);
|
||||
pageImage.fill(Qt::transparent);
|
||||
QPixmap pageImage((2 * previewWidth) - verticalScrollBarWidth, (2 * previewHeight) - horizontalScrollBarWidth);
|
||||
pageImage.fill(Qt::red);
|
||||
|
||||
QPainter p(&pageImage);
|
||||
p.scale(scalingFactor, scalingFactor);
|
||||
|
Loading…
Reference in New Issue
Block a user