diff options
author | Fox Caminiti <fox@foxcam.net> | 2022-12-22 13:29:02 -0500 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2022-12-22 13:29:02 -0500 |
commit | 375c120d30456738897c4bd775e38aa1db7d239c (patch) | |
tree | 5b365a6233cf736db15fa52fcfac4ba80a986217 /src/imgui_helper_internal.cpp | |
parent | 4854647d659f75ac6cf4575b61d1dcfd25865791 (diff) |
v3.1
Diffstat (limited to 'src/imgui_helper_internal.cpp')
-rw-r--r-- | src/imgui_helper_internal.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/imgui_helper_internal.cpp b/src/imgui_helper_internal.cpp index 3267dcc..184930e 100644 --- a/src/imgui_helper_internal.cpp +++ b/src/imgui_helper_internal.cpp @@ -1,12 +1,42 @@ #include "imgui_internal_widgets.h" - #include "imgui.h" #ifndef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS #endif #include "imgui_internal.h" + +// NOTE(fox): This API will change in the future! +void ImGui::MyWindowSetup(ImGuiID id) +{ + ImGuiViewport *Viewport = GetMainViewport(); + ImVec2 WindowMin = Viewport->WorkPos; + ImVec2 WindowSize = Viewport->WorkSize; + + DockBuilderRemoveNode(id); + DockBuilderAddNode(id, ImGuiDockNodeFlags_PassthruCentralNode | ImGuiDockNodeFlags_AutoHideTabBar); + DockBuilderSetNodeSize(id, WindowSize); + DockBuilderSetNodePos(id, WindowMin); + + ImGuiID DockTop = ImGui::DockBuilderSplitNode(id, ImGuiDir_Down, 1.f, nullptr, &id); + ImGuiID DockBottom = ImGui::DockBuilderSplitNode(DockTop, ImGuiDir_Down, 0.4f, nullptr, &DockTop); + ImGuiID DockLeft = ImGui::DockBuilderSplitNode(DockTop, ImGuiDir_Left, 0.15f, nullptr, &DockTop); + ImGuiID DockRight = ImGui::DockBuilderSplitNode(DockTop, ImGuiDir_Right, 0.2f, nullptr, &DockTop); + ImGuiID DockRightBottom = ImGui::DockBuilderSplitNode(DockRight, ImGuiDir_Down, 0.2f, nullptr, &DockRight); + ImGuiID DockRightTop = ImGui::DockBuilderSplitNode(DockRight, ImGuiDir_Up, 0.6f, nullptr, &DockRight); + + ImGui::DockBuilderDockWindow("Menu", id); + ImGui::DockBuilderDockWindow("Viewport", DockTop); + ImGui::DockBuilderDockWindow("Timeline", DockBottom); + ImGui::DockBuilderDockWindow("Properties###Properties", DockLeft); + ImGui::DockBuilderDockWindow("Colors", DockRightTop); + ImGui::DockBuilderDockWindow("Files", DockRight); + ImGui::DockBuilderDockWindow("Effects list", DockRightBottom); + + ImGui::DockBuilderFinish(id); +} + // A modded version of ScalarSlider allowing for the minimum and maximum parts // of the slider to be draggable by two other buttons. p_mid is from range -1 // to 1, and s_min and max are from 0-1. |