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 <[email protected]>
This commit is contained in:
Sean Healy
2017-10-18 23:07:47 +02:00
committed by Adrien Destugues
parent d566b4d9dd
commit 7e42e5b5a4
+2
View File
@@ -1243,10 +1243,12 @@ BTabView::RemoveTab(int32 index)
else if (index <= fSelection) else if (index <= fSelection)
Select(fSelection - 1); Select(fSelection - 1);
if (fFocus >= 0) {
if (fFocus == CountTabs() - 1 || CountTabs() == 0) if (fFocus == CountTabs() - 1 || CountTabs() == 0)
SetFocusTab(fFocus, false); SetFocusTab(fFocus, false);
else else
SetFocusTab(fFocus, true); SetFocusTab(fFocus, true);
}
return tab; return tab;
} }