summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
authormegabigbug <megabigbug@arrakis.(none)>2009-09-20 15:40:53 +0200
committermegabigbug <megabigbug@arrakis.(none)>2009-09-20 15:40:53 +0200
commit8e929438e9b3ecd83499cc58bbbd406175195543 (patch)
tree212bd98a92bc9894e0bd5123e66de2a179aa9748 /src/mainview.cpp
parentcreate function fix (diff)
downloadrekonq-8e929438e9b3ecd83499cc58bbbd406175195543.tar.xz
fix previews:
-tab preview uses websnap -remove scrollbars -antialiased preview
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 87dbfaa1..97199e69 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;
@@ -673,7 +662,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);