norgepaul / TChromeTabs

Comprehensive Delphi implementation of Chrome's tab system
Other
218 stars 78 forks source link

Delete Tab logic faulty when tab is flanked by invisible tabs. #37

Closed Andyk123 closed 8 years ago

Andyk123 commented 8 years ago

When a tab is deleted, the active tab becomes the tab to the left of the deleted tab. The tab becomes active even if it is invisible. This forces the renderer to draw the invisible tab.

I fixed the problem with following code change in TChromeTabsList.DeleteTab

if NewIdx > Count - 1 then
  NewIdx := Count - 1;
while (NewIdx<>-1) and not(Items[NewIdx].visible) do
  dec(NewIdx);
if NewIdx <> -1 then
  Items[NewIdx].Active := TRUE;
norgepaul commented 8 years ago

Fixed