Imgui: Potential new feature: Maximize/Restore button for window

Created on 26 Sep 2018  路  5Comments  路  Source: ocornut/imgui


**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.

ImGui::Begin("windows",&_isVisible, ImGuiWindowFlags_MaximizeButton)

Screenshots/Video
imgui_maximize_button2

enhancement

Most helpful comment

All 5 comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NPatch picture NPatch  路  3Comments

mnemode2 picture mnemode2  路  3Comments

DarkLinux picture DarkLinux  路  3Comments

GrammarLord picture GrammarLord  路  3Comments

the-lay picture the-lay  路  3Comments