diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-27 00:28:03 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-27 00:28:03 +0200 |
| commit | ad15a056672f049cf8302fc7a0a94b71f42db356 (patch) | |
| tree | 3dafbbd36648ba664dc836fff6bf5e42bd274c77 /src/widgets/browsertabbar.cpp | |
| parent | a2d567a95e388e946cae8b0a5e30a7428f12eba4 (diff) | |
| download | kristall-ad15a056672f049cf8302fc7a0a94b71f42db356.tar.gz | |
Allows middle-clicking to close tabs.
Diffstat (limited to 'src/widgets/browsertabbar.cpp')
| -rw-r--r-- | src/widgets/browsertabbar.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/widgets/browsertabbar.cpp b/src/widgets/browsertabbar.cpp new file mode 100644 index 0000000..503157f --- /dev/null +++ b/src/widgets/browsertabbar.cpp @@ -0,0 +1,18 @@ +#include "browsertabbar.hpp" + +#include <QMouseEvent> + +BrowserTabBar::BrowserTabBar(QWidget *parent) : + QTabBar(parent) +{ + +} + +void BrowserTabBar::mouseReleaseEvent(QMouseEvent *event) +{ + if(event->button() == Qt::MiddleButton) { + emit tabCloseRequested(this->tabAt(event->pos())); + } else { + QTabBar::mousePressEvent(event); + } +} |
