mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-24 21:38:45 -04:00
closing a tab keeps the scroll position of the right tab
QTabBar::setSelectionBehaviorOnRemove seems to reset the scroll position of the selected tab, set the current index manually keeps it.
This commit is contained in:
parent
e7b986285a
commit
d7e0fcba59
@ -252,11 +252,10 @@ void TabBar::closeTab(int index)
|
||||
|
||||
void TabBar::setSelectionBehaviorOnRemove(int index)
|
||||
{
|
||||
if (index == count() - 2)
|
||||
{
|
||||
QTabBar::setSelectionBehaviorOnRemove(QTabBar::SelectLeftTab);
|
||||
if (index == count() - 2) {
|
||||
setCurrentIndex(0);
|
||||
} else {
|
||||
QTabBar::setSelectionBehaviorOnRemove(QTabBar::SelectRightTab);
|
||||
setCurrentIndex(index + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user