summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp4
-rw-r--r--src/mainview.cpp4
-rw-r--r--src/mainview.h3
-rw-r--r--src/webpage.cpp2
-rw-r--r--src/websnap.cpp8
5 files changed, 12 insertions, 9 deletions
diff --git a/src/application.cpp b/src/application.cpp
index e58e8843..5b98fafa 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -366,7 +366,7 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type)
{
case Rekonq::NewTab:
if( ReKonfig::openTabNoWindow() )
- tab = w->mainView()->newWebTab(!ReKonfig::openTabsBack(), ReKonfig::openTabsNearCurrent());
+ tab = w->mainView()->newWebTab( !ReKonfig::openTabsBack() );
else
{
w = newMainWindow();
@@ -377,7 +377,7 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type)
tab = w->mainView()->newWebTab(true);
break;
case Rekonq::NewBackTab:
- tab = w->mainView()->newWebTab(false, ReKonfig::openTabsNearCurrent());
+ tab = w->mainView()->newWebTab(false);
break;
case Rekonq::NewWindow:
case Rekonq::CurrentTab:
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 5b2408da..1f252696 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -318,7 +318,7 @@ WebTab *MainView::webTab(int index) const
}
-WebTab *MainView::newWebTab(bool focused, bool nearParent)
+WebTab *MainView::newWebTab(bool focused)
{
WebTab* tab = new WebTab(this);
UrlBar *bar = new UrlBar(tab);
@@ -335,7 +335,7 @@ WebTab *MainView::newWebTab(bool focused, bool nearParent)
connect(tab->view()->page(), SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested()));
connect(tab->view()->page(), SIGNAL(printRequested(QWebFrame *)), this, SIGNAL(printRequested(QWebFrame *)));
- if (nearParent)
+ if ( ReKonfig::openTabsNearCurrent() )
{
insertTab(currentIndex() + 1, tab, i18n("(Untitled)"));
_widgetBar->insertWidget(currentIndex() + 1, bar);
diff --git a/src/mainview.h b/src/mainview.h
index f0a1982f..2ece6fe4 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -96,10 +96,9 @@ public:
* with a webview inside
* @param focused decide if you wannna give focus
* (or not) to this new tab (default true)
- * @param nearParent decide if you wanna create new tab near current or not
* @return the webview embedded in the new tab
*/
- WebTab *newWebTab(bool focused = true, bool nearParent = false);
+ WebTab *newWebTab(bool focused = true);
inline QList<HistoryItem> recentlyClosedTabs() { return m_recentlyClosedTabs; }
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 9e539f7a..939d7128 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -294,7 +294,7 @@ WebPage *WebPage::createWindow(QWebPage::WebWindowType type)
WebTab *w = 0;
if (ReKonfig::openTabNoWindow())
{
- w = Application::instance()->mainWindow()->mainView()->newWebTab(!ReKonfig::openTabsBack(), ReKonfig::openTabsNearCurrent());
+ w = Application::instance()->mainWindow()->mainView()->newWebTab( !ReKonfig::openTabsBack() );
}
else
{
diff --git a/src/websnap.cpp b/src/websnap.cpp
index 29201215..1405fb6e 100644
--- a/src/websnap.cpp
+++ b/src/websnap.cpp
@@ -96,8 +96,12 @@ QPixmap WebSnap::render(const QWebPage &page, int w, int h)
QPixmap WebSnap::renderTabPreview(const QWebPage &page, int w, int h)
-{
- QPixmap pageImage = WebSnap::render(page, page.viewportSize().width()+17, page.viewportSize().height());
+{
+ QSize oldSize = page.viewportSize();
+ int width = page.mainFrame()->contentsSize().width();
+ page.setViewportSize(QSize(width, width * ((0.0 + h) / w)));
+ QPixmap pageImage = WebSnap::render(page, page.viewportSize().width(), page.viewportSize().height());
+ page.setViewportSize(oldSize);
return pageImage.scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
}