summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexandr Domrachev <alexandr.domrachev@gmail.com>2009-04-27 18:42:51 +0000
committerAlexandr Domrachev <alexandr.domrachev@gmail.com>2009-04-27 18:42:51 +0000
commit2382db2c27728214cb9645fee3ef49222ca8dcd5 (patch)
treeda0b6fa0ff178f301f14b8354003d0cef37c7ddb /src
parentOpen new tab on TabBar double click (diff)
downloadrekonq-2382db2c27728214cb9645fee3ef49222ca8dcd5.tar.xz
TabBar context menu fix ported
Diffstat (limited to 'src')
-rw-r--r--src/mainview.cpp10
-rw-r--r--src/mainview.h1
-rw-r--r--src/tabbar.cpp3
3 files changed, 13 insertions, 1 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index dc614f5c..c3818b50 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -231,6 +231,16 @@ void MainView::mouseDoubleClickEvent(QMouseEvent *event)
}
+void MainView::contextMenuEvent(QContextMenuEvent *event)
+{
+ if (!childAt(event->pos()))
+ {
+ m_tabBar->contextMenuRequested(event->pos());
+ return;
+ }
+ KTabWidget::contextMenuEvent(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 77976551..97b9fbad 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -105,6 +105,7 @@ public:
protected:
virtual void mouseDoubleClickEvent(QMouseEvent *event);
+ virtual void contextMenuEvent(QContextMenuEvent *event);
public slots:
/**
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index 6914ef77..f11ea688 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -49,7 +49,8 @@ TabBar::TabBar(QWidget *parent)
setElideMode(Qt::ElideRight);
setContextMenuPolicy(Qt::CustomContextMenu);
setMovable(true);
- connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &)));
+ connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this,
+ SLOT(contextMenuRequested(const QPoint &)));
// tabbar font
QFont standardFont = KGlobalSettings::generalFont();