-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Potential new feature: Maximize/Restore button for window #2104
Comments
I was making a few more tests and I'm unsure of a certain scenario. Right now after maximizing, the Resize handle on bottom right corner still shows and will allow resize. It doesn't necessary break anything but my question is, which one of the following would be more suitable:
Opinions are appreciated, would like to hear @ocornut (sorry for ping) opinion on this. |
Sorry won't have time to look at this in details right away but it is interesting. Quick notes:
|
Hi, sorry for the delay answering, and thank you for your comment. I've been taking a look at more code as I'm not super familiar with imgui internally, mostly only from a using standpoint. 1 - Makes sense, and should be doable, when detecting a window is maximized and changes to display just update the size. 2- I like this, worse case scenario we only write the bool. Alternative would be not to save any bool and to detect if window is maximized and save the restore value instead. This way when session restarts window would not be maximized. While this breaks the "remember all positions and sizes" it's a specific case of a maximized window, user just had to press it maximize again. Maybe not a good idea, just throwing the idea. 3 - Agree 5 - So in the case of a ImGuiWindowFlags_NoMaximize the default would be to show the maximize button? 6 - this could work, I'll run some tests with this too |
@ocornut Another thing we need to consider is how this works in concert with the dockable solution. While in theory these controls are not exposed for the windows. In practice someone will inadvertently find a way to maximize while docked. Need to make sure that the persistence is going to work as expected with that scenario as well. |
Thanks for inspiring! I'm writing a demo program with GUI for my course(Data Structure) project. This enhancement helps me a lot. |
Hi, the link https://github.com/DJLink/imgui/commit/d1fd4909b869e8b50a0519864ba515b9cc2902cb does not work anymore. |
I don't recall deleting the repo but it doesn't exist anymore, so I guess I did, sorry. I must have the source somewhere in one of my projects but I'll have to look into my old computer to see if where it's at, if at all. It's been a couple years sorry |
I see. If you find it, it would be nice to share the code. Otherwise I will have to write it myself. |
**Version/Branch of Dear ImGui: 1.66 WIP
My Issue/Question: Hi, while building/using my editor I sometimes felt the need to quickly maximize a imgui window to the full size of the window, so I did a few hacks to get a button next to the close one. Got it working, also stores the last position/size at the moment maximize is called so when button is pressed again it will restore the last settings. This is not being saved when restoring a session so might be some side effects, but not sure if we really want that.
I pushed a code to a repo so anyone can take a look. Feel free to suggest changes to both the way it works or the code.
Link to code: https://github.com/DJLink/imgui/commit/d1fd4909b869e8b50a0519864ba515b9cc2902cb
For now it works on request only, so user has to pass a flag to ImGui::Begin(), like this. It will detect for the presence of ImGuiWindowFlags_NoResize, in which case it never shows even with ImGuiWindowFlags_MaximizeButton present.
Screenshots/Video
The text was updated successfully, but these errors were encountered: