mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-22 15:46:35 +00:00
Window: Auto-fit size takes account of work rectangle (menu bars eating from viewport). (#5843)
This commit is contained in:
parent
86f2af2bc7
commit
6e9dfe1de1
@ -138,6 +138,7 @@ Other Changes:
|
||||
- Tabs: Enforcing minimum size of 1.0f, fixed asserting on zero-tab widths. (#5572)
|
||||
- Window: Fixed a potential crash when appending to a child window. (#5515, #3496, #4797) [@rokups]
|
||||
- Window: Fixed an issue where uncollapsed a window would show a scrollbar for a frame.
|
||||
- Window: Auto-fit size takes account of work rectangle (menu bars eating from viewport). (#5843)
|
||||
- IO: Added ImGuiMod_Shortcut which is ImGuiMod_Super on Mac and ImGuiMod_Ctrl otherwise. (#456)
|
||||
- IO: Added ImGuiKey_MouseXXX aliases for mouse buttons/wheel so all operations done on ImGuiKey
|
||||
can apply to mouse data as well. (#4921)
|
||||
|
@ -5732,8 +5732,7 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont
|
||||
if (is_popup || is_menu) // Popups and menus bypass style.WindowMinSize by default, but we give then a non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups)
|
||||
size_min = ImMin(size_min, ImVec2(4.0f, 4.0f));
|
||||
|
||||
// FIXME-VIEWPORT-WORKAREA: May want to use GetWorkSize() instead of Size depending on the type of windows?
|
||||
ImVec2 avail_size = ImGui::GetMainViewport()->Size;
|
||||
ImVec2 avail_size = ImGui::GetMainViewport()->WorkSize;
|
||||
ImVec2 size_auto_fit = ImClamp(size_desired, size_min, ImMax(size_min, avail_size - style.DisplaySafeAreaPadding * 2.0f));
|
||||
|
||||
// When the window cannot fit all contents (either because of constraints, either because screen is too small),
|
||||
|
Loading…
Reference in New Issue
Block a user