Do not force the keyboard focus if there wasn't one

Removing tabs tries to preserve the keyboard focus, but it should also
preserve the absence of it.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
Sean Healy 2017-10-18 23:07:47 +02:00 committed by Adrien Destugues
parent d566b4d9dd
commit 7e42e5b5a4
1 changed files with 6 additions and 4 deletions

View File

@ -1243,10 +1243,12 @@ BTabView::RemoveTab(int32 index)
else if (index <= fSelection)
Select(fSelection - 1);
if (fFocus >= 0) {
if (fFocus == CountTabs() - 1 || CountTabs() == 0)
SetFocusTab(fFocus, false);
else
SetFocusTab(fFocus, true);
}
return tab;
}