summaryrefslogtreecommitdiff
path: root/src/webtab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webtab.cpp')
-rw-r--r--src/webtab.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/webtab.cpp b/src/webtab.cpp
index c91c3a20..1519d833 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -36,14 +36,12 @@
#include "application.h"
#include "historymanager.h"
#include "messagebar.h"
-#include "mainwindow.h"
#include "opensearchmanager.h"
#include "previewselectorbar.h"
#include "rsswidget.h"
#include "searchenginebar.h"
#include "sessionmanager.h"
#include "syncmanager.h"
-#include "tabbar.h"
#include "urlbar.h"
#include "walletbar.h"
#include "webpage.h"
@@ -368,7 +366,7 @@ bool WebTab::hasAdBlockedElements()
}
-QPixmap WebTab::tabPreview()
+QPixmap WebTab::tabPreview(int width, int height)
{
if (isPageLoading())
{
@@ -376,12 +374,9 @@ QPixmap WebTab::tabPreview()
return QPixmap();
}
- int w = (parentWidget()->sizeHint().width() / TabBar::baseWidthDivisor);
- int h = w * rApp->mainWindow()->size().height() / rApp->mainWindow()->size().width();
-
if (!part())
{
- return WebSnap::renderPagePreview(*page(), w, h);
+ return WebSnap::renderPagePreview(*page(), width, height);
}
else
{
@@ -390,7 +385,7 @@ QPixmap WebTab::tabPreview()
partWidget->render(&partThumb);
- return partThumb.scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ return partThumb.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
}
}