From a6fbf6d10dc1e4572d891c70015e0b1a05f84005 Mon Sep 17 00:00:00 2001 From: Nikhil Tanwar <2002nikhiltanwar@gmail.com> Date: Tue, 8 Aug 2023 11:02:07 +0530 Subject: [PATCH] Get currentIndex from stackedWidget while closing Earlier, we got the index from cursor's position this led to the close functionality to only work when cursor is hovered over tab title We get the index straight from the stacked widget now. --- src/tabbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tabbar.cpp b/src/tabbar.cpp index eb97683e..7027abde 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -37,7 +37,7 @@ TabBar::TabBar(QWidget *parent) : }); connect(app->getAction(KiwixApp::CloseTabAction), &QAction::triggered, this, [=]() { - auto index = this->tabAt(mapFromGlobal(QCursor::pos())); + auto index = currentIndex(); if (index < 0) return;