TabbedButtonBar::moveTab behaviour


moveTab() only moves the TabBarButtons, but not the pages (the attached contentComponents). So after calling it, the buttons won’t open the right pages.

For example, if you add at the end of the constructor of the DemoTabbedComponent :

getTabbedButtonBar().moveTab (2, 6); // move the "sliders" tab to the end

then, when you click on the “sliders” tab, it’s the DragAndDrop page that pops up, and all the buttons/pages are messed up.
Is that the expected behaviour?


Could we have the following method added to TabbedComponent ?

/** 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) noexcept;

void TabbedComponent::moveTab (const int currentIndex, const int newIndex, const bool animate) noexcept
    contentComponents.move (currentIndex, newIndex);
    tabs->moveTab (currentIndex, newIndex, animate);


Yep, I’ll add that. Thanks!