Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a continuation of the bare-bones tooling added by #332; the layout and rendering of a tab control is now encapsulated into a `TabControl` class. That class takes care of rendering all the tabs and drawing only the correct tab content, as long as you give it string for each title and a `GuiBuilder` to render each tab body. For testing, I declared various sets of tabs, changed the `TabControl` properties, and made sure the tabs rendered and reacted as expected. Eventually I ended up with this monstrosity: ``` private readonly TabControl tabControl = new(("General", DrawGeneral), ("Progression", DrawProgression), ("Tab 1", null), ("Tab 2", null), ("Tab 3", null), ("Tab 4", null), ("Tab 5's title text causes fewer problems", null), ("Tab 6", null), ("Tab 7", null), ("Tab 8 has an obscenely long title text for the purpose of causing as many problems as physically possible", null), ("Tab 9 wants three lines\nin its text, but\nthat doesn't work", null)); ``` I expected Tab 9's title to render on three lines of text, but it only renders on one line. I decided to leave multi-line tab titles as an project for another time.
- Loading branch information