diff options
author | megabigbug <megabigbug@arrakis.(none)> | 2010-07-01 22:28:32 +0200 |
---|---|---|
committer | megabigbug <megabigbug@arrakis.(none)> | 2010-07-01 22:28:32 +0200 |
commit | 52adb3ea4ecc40b740faf28920dd7354695a0953 (patch) | |
tree | 7860bcb069d6c79f1fd50c69db45448c014926cf /src/websnap.cpp | |
parent | SVN_SILENT made messages (.desktop file) (diff) | |
download | rekonq-52adb3ea4ecc40b740faf28920dd7354695a0953.tar.xz |
fix tab preview when tab has never been focused. (old bug, fixed, reintroduced, fixed again etc)
Diffstat (limited to 'src/websnap.cpp')
-rw-r--r-- | src/websnap.cpp | 8 |
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); } |