summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
authormegabigbug <megabigbug@arrakis.(none)>2009-09-22 15:45:18 +0200
committermegabigbug <megabigbug@arrakis.(none)>2009-09-22 15:45:18 +0200
commitc64f84da6627ecd09d74f1e0ff2aa62f47a30c60 (patch)
tree25620771556c019b808332f074aa9816fe08d828 /src/mainview.cpp
parentsmall fix of tab preview behavior (diff)
parentFixing foreach macros.. (diff)
downloadrekonq-c64f84da6627ecd09d74f1e0ff2aa62f47a30c60.tar.xz
Merge branch 'master' of git://gitorious.org/rekonq/mainline
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 6ef99b9b..47e39524 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -42,6 +42,7 @@
#include "webview.h"
#include "sessionmanager.h"
#include "homepage.h"
+#include "websnap.h"
// KDE Includes
#include <KUrl>
@@ -645,18 +646,6 @@ void MainView::leaveEvent(QEvent *event)
KTabWidget::leaveEvent(event);
}
-QPixmap MainView::renderTabPreview(int tab, int w, int h)
-{
- QPixmap image = QPixmap(webView(tab)->width(), webView(tab)->height());
- image.fill(Qt::transparent);
- QPainter p(&image);
- webView(tab)->page()->mainFrame()->render(&p);
- p.end();
- image = image.scaled(w, h, Qt::KeepAspectRatioByExpanding);
-
- return image;
-}
-
void MainView::showTabPreview(int tab)
{
int w=200;
@@ -672,7 +661,7 @@ void MainView::showTabPreview(int tab)
m_previewPopup->setFrameShape(QFrame::NoFrame);
m_previewPopup->setFixedSize(w, h);
QLabel *l = new QLabel();
- l->setPixmap(renderTabPreview(tab, w, h));
+ l->setPixmap(WebSnap::renderPreview(webView(tab)->page(), w, h));
m_previewPopup->setView(l);
m_previewPopup->layout()->setAlignment(Qt::AlignTop);
m_previewPopup->layout()->setMargin(0);