summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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();