Skip to content
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

demo request: storing multiple docker/viewport layouts in imgui.ini #109

Closed
dgm3333 opened this issue May 29, 2023 · 1 comment
Closed

Comments

@dgm3333
Copy link

dgm3333 commented May 29, 2023

The issue of how to store and retrieve multiple layouts has been discussed a bit, but I think a good example would be extremely valuable, and would promote use of docker/viewports much more broadly, and extend your docking example. This currently has "restore default layout" - which is obviously already a good start on this.

This would mean not only would the positions of all the windows be saved, but their current state (visible or not) on close or at a specific saved/restore point.

This has been discussed a few times, but otherwise not comprehensively managed
ocornut/imgui#4033
ocornut/imgui#2564
pthom/hello_imgui#52

@pthom
Copy link
Owner

pthom commented Jun 6, 2023

@dgm3333

I recently added an interesting feature: the possibility to define several layouts and switch between them.

Each layout is stored in a DockingParams, and:

  • can contain a different list of windows (vector<DockableWindow>)
  • has a different spatial layout (vector<DockingSplit>)
  • remembers and restores the user modifications to this given layout
  • remembers and restores the list of Opened windows

See this video demo and explanation

Also, see the corresponding code:

@pthom pthom closed this as completed Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants