summaryrefslogtreecommitdiff
path: root/src/tabbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r--src/tabbar.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index bde1e63e..73788094 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -190,21 +190,23 @@ void TabBar::reloadTab()
void TabBar::showTabPreview(int tab)
{
WebView *view = m_parent->webView(tab);
-
+ WebView *currentView = m_parent->webView(currentIndex());
+
int w = tabSizeHint(tab).width();
- int h = w*((0.0 + view->height())/view->width());
+ int h = w*((0.0 + currentView->height())/currentView->width());
//delete previous tab preview
if (m_previewPopup)
{
delete m_previewPopup;
}
-
+
m_previewPopup = new KPassivePopup(this);
m_previewPopup->setFrameShape(QFrame::StyledPanel);
m_previewPopup->setFrameShadow(QFrame::Plain);
m_previewPopup->setFixedSize(w, h);
QLabel *l = new QLabel();
+ view->page()->setViewportSize(currentView->page()->viewportSize());
l->setPixmap(WebSnap::renderPreview(*(view->page()), w, h));
m_previewPopup->setView(l);
m_previewPopup->layout()->setAlignment(Qt::AlignTop);