New Tabs Widget for Mobile Phones

Started by RGPaul, 03 March 2023, 19:07:16

RGPaul

I want to create a Widget that is very similar to the current Tabs class.
Perhaps just adding an Icon to every Tab and adjust the text position.

Any recommendations? Is it possible to create a subclass of the Tabs widget and use the subclass within the current TabContainer widget?

I read the current implementation of the Tabs widget and there is a Tab struct that is private. So I cannot add an image there easily.

texus

I would just recommend copying the code from the Tabs class and editing that copy.

You could technically inherit from Tabs, but then you would need to store a list of images that has the same length as the list of tabs. So every function that adds or removes a tab needs to be overridden in your new class (and these functions aren't virtual, so you need to understand the limitations of doing this and watch out for them).

RGPaul

Thanks for your suggestion.
Copying the code seems to be the cleanest and easiest way indeed.