How to make "Add Tab" button in tab bar

gui

#1

What is the best way to make “Add Tab” button in the tab bar?

I use a TabbedComponent derive class in my App. It’s easy and works fine. Now I want to make a button for adding a new tab dynamically in the tab bar, just like Google Chrome or FireFox. Is there a good way to do this?

At first I thought I could do by just overriding TabbedComponent::createTabButton() to make a custom “Add Tab” button at the end of the tab button series. However, the problem is that the button could be hidden when you add a lot of tabs and run out the space.

Maybe I could customize TabbedButtonBar::updateTabPositions() to make it always show the “Add Tab” button but I don’t think its a recommended way.

Does anybody have a good solution?