summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Tröscher <fritz_van_tom@hotmail.com>2011-11-18 16:57:05 +0100
committerJohannes Tröscher <fritz_van_tom@hotmail.com>2011-11-18 16:57:05 +0100
commit2f115c0bf0ad58a6a98d1e9874710efae5350ff0 (patch)
tree59ccbbebf2f8f2a6eff7ccd0546ea4084f5f837a
parentAdblock disabled by default for 0.9 (diff)
downloadrekonq-2f115c0bf0ad58a6a98d1e9874710efae5350ff0.tar.xz
have tabPreviews of KParts also
REVIEW: 103179 REVIEWED-BY: adjam
-rw-r--r--src/tabpreviewpopup.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tabpreviewpopup.cpp b/src/tabpreviewpopup.cpp
index b94cf425..31d3cca9 100644
--- a/src/tabpreviewpopup.cpp
+++ b/src/tabpreviewpopup.cpp
@@ -99,7 +99,15 @@ void TabPreviewPopup::setWebTab(WebTab* tab)
int w = (tab->parentWidget()->sizeHint().width() / TabBar::baseWidthDivisor);
int h = w * rApp->mainWindow()->size().height() / rApp->mainWindow()->size().width();
- setThumbnail(WebSnap::renderTabPreview(*tab->page(), w, h));
+ if (!tab->part())
+ setThumbnail(WebSnap::renderTabPreview(*tab->page(), w, h));
+ else
+ {
+ QWidget *part = tab->part()->widget();
+ QPixmap partThumb(part->size());
+ part->render(&partThumb);
+ setThumbnail(partThumb.scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
+ }
setUrl(tab->url().prettyUrl());
setFixedSize(w, h + m_url->heightForWidth(w));