diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-10-25 11:09:12 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-10-25 11:09:12 +0100 |
commit | b389f01eee0c5bd3deba212853124bc8010a6c8c (patch) | |
tree | 4e2a00c676dfb8ee24440c88bffadd4dbe78b677 /src | |
parent | cloneTab patch (diff) | |
download | rekonq-b389f01eee0c5bd3deba212853124bc8010a6c8c.tar.xz |
Just close tab on middle mouse click
Diffstat (limited to 'src')
-rw-r--r-- | src/tabbar.cpp | 13 | ||||
-rw-r--r-- | src/tabbar.h | 1 |
2 files changed, 14 insertions, 0 deletions
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() { diff --git a/src/tabbar.h b/src/tabbar.h index 580021c4..57b78628 100644 --- a/src/tabbar.h +++ b/src/tabbar.h @@ -79,6 +79,7 @@ protected: virtual QSize tabSizeHint(int index) const; virtual void mouseMoveEvent(QMouseEvent *event); virtual void leaveEvent(QEvent *event); + virtual void mousePressEvent(QMouseEvent *event); private slots: void cloneTab(); |