summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid E. Narváez <david.narvaez@computer.org>2012-04-17 01:58:25 -0500
committerDavid E. Narváez <david.narvaez@computer.org>2012-04-17 01:58:25 -0500
commit14f5f78b2c59d40207ff0e988200ef0180bd1081 (patch)
tree86e8487062d1826ceb053614751668d1fbaabea8
parentReally fix Upper case urls management (diff)
downloadrekonq-14f5f78b2c59d40207ff0e988200ef0180bd1081.tar.xz
Remove tabbar.h and mainwindow.h Dependencies from webtab.cpp
Fixes previous attempt to move tab preview to WebTab class. REVIEW: 104517
-rw-r--r--src/tabpreviewpopup.cpp4
-rw-r--r--src/webtab.cpp11
-rw-r--r--src/webtab.h2
3 files changed, 7 insertions, 10 deletions
diff --git a/src/tabpreviewpopup.cpp b/src/tabpreviewpopup.cpp
index 821c033c..52c06cfb 100644
--- a/src/tabpreviewpopup.cpp
+++ b/src/tabpreviewpopup.cpp
@@ -98,7 +98,9 @@ TabPreviewPopup::~TabPreviewPopup()
void TabPreviewPopup::setWebTab(WebTab* tab)
{
- const QPixmap preview = tab->tabPreview();
+ int w = (tab->parentWidget()->sizeHint().width() / TabBar::baseWidthDivisor);
+ int h = w * rApp->mainWindow()->size().height() / rApp->mainWindow()->size().width();
+ const QPixmap preview = tab->tabPreview(w, h);
if (!preview.isNull())
{
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);
}
}
diff --git a/src/webtab.h b/src/webtab.h
index c318da10..e9805846 100644
--- a/src/webtab.h
+++ b/src/webtab.h
@@ -92,7 +92,7 @@ public:
bool hasAdBlockedElements();
- QPixmap tabPreview();
+ QPixmap tabPreview(int width, int height);
private Q_SLOTS:
void updateProgress(int progress);