| 6488 | } |
| 6489 | |
| 6490 | static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags) |
| 6491 | { |
| 6492 | // Create window the first time |
| 6493 | //IMGUI_DEBUG_LOG("CreateNewWindow '%s', flags = 0x%08X\n", name, flags); |
| 6494 | ImGuiContext& g = *GImGui; |
| 6495 | ImGuiWindow* window = IM_NEW(ImGuiWindow)(&g, name); |
| 6496 | window->Flags = flags; |
| 6497 | g.WindowsById.SetVoidPtr(window->ID, window); |
| 6498 | |
| 6499 | ImGuiWindowSettings* settings = NULL; |
| 6500 | if (!(flags & ImGuiWindowFlags_NoSavedSettings)) |
| 6501 | if ((settings = ImGui::FindWindowSettingsByWindow(window)) != 0) |
| 6502 | window->SettingsOffset = g.SettingsWindows.offset_from_ptr(settings); |
| 6503 | |
| 6504 | InitOrLoadWindowSettings(window, settings); |
| 6505 | |
| 6506 | if (flags & ImGuiWindowFlags_NoBringToFrontOnFocus) |
| 6507 | g.Windows.push_front(window); // Quite slow but rare and only once |
| 6508 | else |
| 6509 | g.Windows.push_back(window); |
| 6510 | |
| 6511 | return window; |
| 6512 | } |
| 6513 | |
| 6514 | static inline ImVec2 CalcWindowMinSize(ImGuiWindow* window) |
| 6515 | { |
no test coverage detected