|
@@ -5676,22 +5676,25 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags)
|
|
|
|
|
|
static inline ImVec2 CalcWindowMinSize(ImGuiWindow* window)
|
|
|
{
|
|
|
- // Popups, menus and childs bypass style.WindowMinSize by default, but we give then a non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups)
|
|
|
- // FIXME: the if/else could probably be removed, "reduce artifacts" section for all windows.
|
|
|
+ // We give windows non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups)
|
|
|
+ // FIXME: Essentially we want to restrict manual resizing to WindowMinSize+Decoration, and allow api resizing to be smaller.
|
|
|
+ // Perhaps should tend further a neater test for this.
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
ImVec2 size_min;
|
|
|
- if (window->Flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_ChildMenu | ImGuiWindowFlags_ChildWindow))
|
|
|
+ if ((window->Flags & ImGuiWindowFlags_ChildWindow) && !(window->Flags & ImGuiWindowFlags_Popup))
|
|
|
{
|
|
|
size_min.x = (window->ChildFlags & ImGuiChildFlags_ResizeX) ? g.Style.WindowMinSize.x : 4.0f;
|
|
|
size_min.y = (window->ChildFlags & ImGuiChildFlags_ResizeY) ? g.Style.WindowMinSize.y : 4.0f;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ImGuiWindow* window_for_height = window;
|
|
|
size_min.x = ((window->Flags & ImGuiWindowFlags_AlwaysAutoResize) == 0) ? g.Style.WindowMinSize.x : 4.0f;
|
|
|
size_min.y = ((window->Flags & ImGuiWindowFlags_AlwaysAutoResize) == 0) ? g.Style.WindowMinSize.y : 4.0f;
|
|
|
- size_min.y = ImMax(size_min.y, window_for_height->TitleBarHeight() + window_for_height->MenuBarHeight() + ImMax(0.0f, g.Style.WindowRounding - 1.0f)); // Reduce artifacts with very small windows
|
|
|
}
|
|
|
+
|
|
|
+ // Reduce artifacts with very small windows
|
|
|
+ ImGuiWindow* window_for_height = window;
|
|
|
+ size_min.y = ImMax(size_min.y, window_for_height->TitleBarHeight() + window_for_height->MenuBarHeight() + ImMax(0.0f, g.Style.WindowRounding - 1.0f));
|
|
|
return size_min;
|
|
|
}
|
|
|
|
|
@@ -6755,6 +6758,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
#endif
|
|
|
|
|
|
// Handle manual resize: Resize Grips, Borders, Gamepad
|
|
|
+ // FIXME: _ChildWindow + _Popup windows may want resize grips.
|
|
|
int border_hovered = -1, border_held = -1;
|
|
|
ImU32 resize_grip_col[4] = {};
|
|
|
const int resize_grip_count = (window->Flags & ImGuiWindowFlags_ChildWindow) ? 0 : g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // Allow resize from lower-left if we have the mouse cursor feedback for it.
|