Browse Source

TabbedComponent::removeTab fix.

tags/2021-05-28
jules 12 years ago
parent
commit
a0e292bdaf
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp

+ 3
- 2
modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp 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();
}


Loading…
Cancel
Save