summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandr Domrachev <alexandr.domrachev@gmail.com>2009-04-27 18:05:39 +0000
committerAlexandr Domrachev <alexandr.domrachev@gmail.com>2009-04-27 18:05:39 +0000
commit61172b031c59d7f78447d224963b1333ce1d92bd (patch)
treec840b9a938557f67f70475cc1434762ed4cef2b0
parentTabBar code clean. Icons added to context menu (diff)
downloadrekonq-61172b031c59d7f78447d224963b1333ce1d92bd.tar.xz
Open new tab on TabBar double click
-rw-r--r--src/mainview.cpp13
-rw-r--r--src/mainview.h3
2 files changed, 16 insertions, 0 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 8cf09e2a..dc614f5c 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -218,6 +218,19 @@ void MainView::clear()
}
+void MainView::mouseDoubleClickEvent(QMouseEvent *event)
+{
+ if (!childAt(event->pos())
+ // Remove the line below when QTabWidget does not have a one pixel frame
+ && event->pos().y() < (tabBar()->y() + tabBar()->height()))
+ {
+ newWebView(true);
+ return;
+ }
+ KTabWidget::mouseDoubleClickEvent(event);
+}
+
+
// When index is -1 index chooses the current tab
void MainView::slotReloadTab(int index)
{
diff --git a/src/mainview.h b/src/mainview.h
index 35f887fd..77976551 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -103,6 +103,9 @@ public:
void showTabBar();
void clear();
+protected:
+ virtual void mouseDoubleClickEvent(QMouseEvent *event);
+
public slots:
/**
* Core browser slot. This create a new tab with a WebView inside