Ticket #13731: TabView_RemoveTab.diff

File TabView_RemoveTab.diff, 589 bytes (added by jalopeura, 7 years ago)
  • src/kits/interface/TabView.cpp

    diff --git a/src/kits/interface/TabView.cpp b/src/kits/interface/TabView.cpp
    index 4b0dec7..d1762ed 100644
    a b BTabView::RemoveTab(int32 index)  
    12431243    else if (index <= fSelection)
    12441244        Select(fSelection - 1);
    12451245
    1246     if (fFocus == CountTabs() - 1 || CountTabs() == 0)
    1247         SetFocusTab(fFocus, false);
    1248     else
    1249         SetFocusTab(fFocus, true);
     1246    if (fFocus >= 0) {
     1247        if (fFocus == CountTabs() - 1 || CountTabs() == 0)
     1248            SetFocusTab(fFocus, false);
     1249        else
     1250            SetFocusTab(fFocus, true);
     1251    }
    12501252
    12511253    return tab;
    12521254}