summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegabigbug <megabigbug@arrakis.(none)>2010-07-01 22:28:32 +0200
committermegabigbug <megabigbug@arrakis.(none)>2010-07-01 22:28:32 +0200
commit52adb3ea4ecc40b740faf28920dd7354695a0953 (patch)
tree7860bcb069d6c79f1fd50c69db45448c014926cf
parentSVN_SILENT made messages (.desktop file) (diff)
downloadrekonq-52adb3ea4ecc40b740faf28920dd7354695a0953.tar.xz
fix tab preview when tab has never been focused. (old bug, fixed, reintroduced, fixed again etc)
-rw-r--r--src/websnap.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/websnap.cpp b/src/websnap.cpp
index 29201215..1405fb6e 100644
--- a/src/websnap.cpp
+++ b/src/websnap.cpp
@@ -96,8 +96,12 @@ QPixmap WebSnap::render(const QWebPage &page, int w, int h)
QPixmap WebSnap::renderTabPreview(const QWebPage &page, int w, int h)
-{
- QPixmap pageImage = WebSnap::render(page, page.viewportSize().width()+17, page.viewportSize().height());
+{
+ QSize oldSize = page.viewportSize();
+ int width = page.mainFrame()->contentsSize().width();
+ page.setViewportSize(QSize(width, width * ((0.0 + h) / w)));
+ QPixmap pageImage = WebSnap::render(page, page.viewportSize().width(), page.viewportSize().height());
+ page.setViewportSize(oldSize);
return pageImage.scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
}