瀏覽代碼

Popups: allow Child Popups to be resizable if not explicitly disabling.

ocornut 1 年之前
父節點
當前提交
d3f1a7165c
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      imgui.cpp

+ 1 - 2
imgui.cpp

@@ -6758,10 +6758,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
 #endif
 #endif
 
 
         // Handle manual resize: Resize Grips, Borders, Gamepad
         // Handle manual resize: Resize Grips, Borders, Gamepad
-        // FIXME: _ChildWindow + _Popup windows may want resize grips.
         int border_hovered = -1, border_held = -1;
         int border_hovered = -1, border_held = -1;
         ImU32 resize_grip_col[4] = {};
         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.
+        const int resize_grip_count = ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup)) ? 0 : g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // Allow resize from lower-left if we have the mouse cursor feedback for it.
         const float resize_grip_draw_size = IM_TRUNC(ImMax(g.FontSize * 1.10f, window->WindowRounding + 1.0f + g.FontSize * 0.2f));
         const float resize_grip_draw_size = IM_TRUNC(ImMax(g.FontSize * 1.10f, window->WindowRounding + 1.0f + g.FontSize * 0.2f));
         if (!window->Collapsed)
         if (!window->Collapsed)
             if (int auto_fit_mask = UpdateWindowManualResize(window, size_auto_fit, &border_hovered, &border_held, resize_grip_count, &resize_grip_col[0], visibility_rect))
             if (int auto_fit_mask = UpdateWindowManualResize(window, size_auto_fit, &border_hovered, &border_held, resize_grip_count, &resize_grip_col[0], visibility_rect))