summaryrefslogtreecommitdiff
path: root/src/websnap.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-01-29 11:18:47 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-01-29 11:18:47 +0100
commitef3412789cee141bbd929e062959784332ba6434 (patch)
tree3679851f8d859df8362b66903afba92597e94b91 /src/websnap.cpp
parentFaster way to access the "Add favorite" thing (diff)
downloadrekonq-ef3412789cee141bbd929e062959784332ba6434.tar.xz
Restore scrollbars when using websnap features
BUG:288957
Diffstat (limited to 'src/websnap.cpp')
-rw-r--r--src/websnap.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/websnap.cpp b/src/websnap.cpp
index 3344ded8..6bbaa06a 100644
--- a/src/websnap.cpp
+++ b/src/websnap.cpp
@@ -3,7 +3,7 @@
* This file is a part of the rekonq project
*
* Copyright (C) 2009 Nokia Corporation <qt-info@nokia.com>
-* Copyright (C) 2009-2011 by Andrea Diamantini <adjam7 at gmail dot com>
+* Copyright (C) 2009-2012 by Andrea Diamantini <adjam7 at gmail dot com>
* Copyright (C) 2010 by Matthieu Gicquel <matgic78 at gmail dot com>
*
*
@@ -117,8 +117,10 @@ QPixmap WebSnap::renderClosingPagePreview(const QWebPage &page, int w, int h)
QPixmap WebSnap::renderPagePreview(const QWebPage &page, int w, int h)
{
- //prepare page
+ // remove temporarily scrollbars
page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
+
+ // prepare page
int width = page.mainFrame()->contentsSize().width();
page.setViewportSize(QSize(width, width * ((0.0 + h) / w)));
@@ -128,6 +130,9 @@ QPixmap WebSnap::renderPagePreview(const QWebPage &page, int w, int h)
// resize image
pageImage = pageImage.scaled(w, h, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
+ // restore scrollbars
+ page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded);
+
return pageImage;
}