Merge pull request #343 from kiwix/close-tab-scroll

closing a tab keeps the scroll position of the right tab
This commit is contained in:
Kelson 2020-01-14 14:44:31 +01:00 committed by GitHub
commit a4844b6aea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,11 +252,10 @@ void TabBar::closeTab(int index)
void TabBar::setSelectionBehaviorOnRemove(int index) void TabBar::setSelectionBehaviorOnRemove(int index)
{ {
if (index == count() - 2) if (index == count() - 2) {
{ setCurrentIndex(0);
QTabBar::setSelectionBehaviorOnRemove(QTabBar::SelectLeftTab);
} else { } else {
QTabBar::setSelectionBehaviorOnRemove(QTabBar::SelectRightTab); setCurrentIndex(index + 1);
} }
} }