-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tabs system implementation #1083
Comments
Linking to #261 Luckily I should return back to imgui from mid-april so there is a chance I will finally tackle this and see how we could derive an official feature/extension from the various existing implementations. |
Alright I moved it to a separate header/source file: https://github.com/ScottMudge/imgui_tabs |
@scottmudge : your tab system looks good to me (and code seems compact enough)! |
@Flix01 Fair point, I used STL for simplicity's sake while reasoning through how it would work, but I'll go ahead and replace the STL functions and structures with more portable counterparts and add a subdirectory for each flavor in the repo. |
If you fork it in two it will be annoying for you to maintain it tho, so I'd suggest just keeping one version for sanity purpose! If you don't mind I may grab some parts and ideas from this and other implementations to make one later. |
Good point, suppose I'll back up the STL version and move forward without STL. And for sure, take from it whatever you'd like! |
Thanks a lot for your tabs, working very well. As proof of concept, a little screenshot, including ImGui::Image() + vertical sliders (as testing purpose). @ocornut : thanks again, your dear ImGui is impressive, and I didn't test everything yet (and I'm very far to). Last but not least, my next try will be around SDL_gpu from Jonathan Dearborn ( see https://github.com/grimfang4/sdl-gpu). People who tested should recognize the image ;-) The relevant code is very simple (limited to tabs use there): ''''
// ImGui::VSliderFloat("##v", ImVec2(18,160), &values[i], 0.0f, 1.0f, "");
'''' |
Important : to avoid leaks, clean the textureID just after ImGui::Render() : ``
// (...) end of loop `` |
There is an issue and I propose a fix. Since I don't know how to create a pull request, please have a look at https://github.com/ebachard/imgui_tabs For the record, I'll attach a screenshot showing how it works now in an issue I'll create, directly on your repo. |
Closing this thread as a duplicate of #261 (and I made a post there to refer to this one). I started working an an officially maintained implementation of this. I don't yet know how it will be distributed, and I want to encourage extensions (just like the one you did), so it might end up in its own repository eventually. Thanks Scott for working on it :) |
Just curious if anyone wanted my modular implementation of tabs for ImGui.
Code like this:
Yields results like this:
Size and spacing of the tabs adjusts automatically to font sizes, number of tabs, etc. Dynamically changing the number of tabs (removing/adding at any time) is also supported.
Just seeing if the community wanted it. It should be forward compatible, as it extends ImGui by using the imgui_user.h and imgui_user.cpp files.
The text was updated successfully, but these errors were encountered: