Skip to content

Commit

Permalink
Get currentIndex from stackedWidget while closing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
juuz0 authored and kelson42 committed Aug 9, 2023
1 parent 59d1ff7 commit a6fbf6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tabbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a6fbf6d

Please sign in to comment.