1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

TabbedComponent::removeTab fix.

This commit is contained in:
jules 2013-07-09 17:25:04 +01:00
parent 82d305a2a2
commit a0e292bdaf

View file

@ -271,12 +271,13 @@ void TabbedButtonBar::setTabName (const int tabIndex, const String& newName)
void TabbedButtonBar::removeTab (const int tabIndex)
{
const int oldIndex = currentTabIndex;
if (tabIndex == currentTabIndex)
setCurrentTabIndex (-1);
TabInfo* const currentTab = tabs [currentTabIndex];
tabs.remove (tabIndex);
currentTabIndex = tabs.indexOf (currentTab);
setCurrentTabIndex (oldIndex);
resized();
}