Skip to content

Commit 09c3cba

Browse files
committed
add functions to enable/disable docking
1 parent ee6240d commit 09c3cba

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

Diff for: include/mahi/imgui_custom.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ void EnableViewports();
1212
/// Disable Viewports
1313
void DisableViewports();
1414

15+
/// Enable Docking
16+
void EnableDocking();
17+
18+
/// Disable Docking
19+
void DisableDocking();
20+
1521
/// Begins a fixed size ImGui window (useful for single window apps)
1622
bool BeginFixed(const char* name, const ImVec2& pos, const ImVec2& size, ImGuiWindowFlags flags = 0);
1723

Diff for: src/mahi/imgui_custom.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,26 @@
1414
namespace ImGui
1515
{
1616

17-
/// Enable Viewports
1817
void EnableViewports()
1918
{
2019
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
2120
}
2221

23-
/// Disable Viewports
2422
void DisableViewports()
2523
{
2624
ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_ViewportsEnable;
2725
}
2826

27+
void EnableDocking()
28+
{
29+
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_DockingEnable;
30+
}
31+
32+
void DisableDocking()
33+
{
34+
ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_DockingEnable;
35+
}
36+
2937
bool BeginFixed(const char *name, const ImVec2 &pos, const ImVec2 &size, ImGuiWindowFlags flags)
3038
{
3139
ImGui::SetNextWindowPos(pos, ImGuiCond_Always);

0 commit comments

Comments
 (0)