From b389f01eee0c5bd3deba212853124bc8010a6c8c Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 25 Oct 2009 11:09:12 +0100 Subject: Just close tab on middle mouse click --- src/tabbar.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/tabbar.cpp') diff --git a/src/tabbar.cpp b/src/tabbar.cpp index bde1e63e..ac050191 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -268,6 +268,19 @@ void TabBar::leaveEvent(QEvent *event) KTabBar::leaveEvent(event); } +void TabBar::mousePressEvent(QMouseEvent *event) +{ + // just close tab on middle mouse click + if (event->button() == Qt::MidButton) + { + int index = tabAt(event->pos()); + emit closeTab(index); + return; + } + + KTabBar::mousePressEvent(event); +} + void TabBar::updateNewTabButton() { -- cgit v1.2.1