aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/browsertabbar.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-27 00:28:03 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-27 00:28:03 +0200
commitad15a056672f049cf8302fc7a0a94b71f42db356 (patch)
tree3dafbbd36648ba664dc836fff6bf5e42bd274c77 /src/widgets/browsertabbar.cpp
parenta2d567a95e388e946cae8b0a5e30a7428f12eba4 (diff)
downloadkristall-ad15a056672f049cf8302fc7a0a94b71f42db356.tar.gz
Allows middle-clicking to close tabs.
Diffstat (limited to 'src/widgets/browsertabbar.cpp')
-rw-r--r--src/widgets/browsertabbar.cpp18
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);
+ }
+}