diff --git a/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp b/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp index 1682cf7865..25d7165898 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp +++ b/modules/juce_gui_basics/layout/juce_TabbedComponent.cpp @@ -174,6 +174,12 @@ void TabbedComponent::removeTab (const int tabIndex) } } +void TabbedComponent::moveTab (const int currentIndex, const int newIndex, const bool animate) +{ + contentComponents.move (currentIndex, newIndex); + tabs->moveTab (currentIndex, newIndex, animate); +} + int TabbedComponent::getNumTabs() const { return tabs->getNumTabs(); diff --git a/modules/juce_gui_basics/layout/juce_TabbedComponent.h b/modules/juce_gui_basics/layout/juce_TabbedComponent.h index 944ff83b79..98f627a366 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedComponent.h +++ b/modules/juce_gui_basics/layout/juce_TabbedComponent.h @@ -116,6 +116,11 @@ public: /** Gets rid of one of the tabs. */ void removeTab (int tabIndex); + /** Moves a tab to a new index in the list. + Pass -1 as the index to move it to the end of the list. + */ + void moveTab (int currentIndex, int newIndex, bool animate = false); + /** Returns the number of tabs in the bar. */ int getNumTabs() const;