Merge branch 'master' into viewport

# Conflicts:
#	examples/imgui_impl_dx10.cpp
#	examples/imgui_impl_dx11.cpp
#	examples/imgui_impl_dx12.cpp
#	examples/imgui_impl_dx9.cpp
#	examples/opengl2_example/imgui_impl_glfw_gl2.cpp
#	examples/opengl3_example/imgui_impl_glfw_gl3.cpp
#	examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp
#	examples/vulkan_example/imgui_impl_glfw_vulkan.cpp
#	imgui.cpp
#	imgui_internal.h
This commit is contained in:
omar
2018-04-18 19:06:49 +02:00
12 changed files with 67 additions and 57 deletions

View File

@ -568,6 +568,7 @@ struct ImGuiNextWindowData
void* SizeCallbackUserData;
float BgAlphaVal;
ImGuiID ViewportId;
ImVec2 MenuBarOffsetMinVal; // This is not exposed publicly, so we don't clear it.
ImGuiNextWindowData()
{
@ -580,6 +581,7 @@ struct ImGuiNextWindowData
SizeCallbackUserData = NULL;
BgAlphaVal = FLT_MAX;
ViewportId = 0;
MenuBarOffsetMinVal = ImVec2(0.0f, 0.0f);
}
void Clear()
@ -878,7 +880,7 @@ struct IMGUI_API ImGuiDrawContext
int NavLayerActiveMask; // Which layer have been written to (result from previous frame)
int NavLayerActiveMaskNext; // Which layer have been written to (buffer for current frame)
bool MenuBarAppending; // FIXME: Remove this
float MenuBarOffsetX;
ImVec2 MenuBarOffset; // MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
ImVector<ImGuiWindow*> ChildWindows;
ImGuiStorage* StateStorage;
ImGuiLayoutType LayoutType;
@ -916,7 +918,7 @@ struct IMGUI_API ImGuiDrawContext
NavLayerCurrent = 0;
NavLayerCurrentMask = 1 << 0;
MenuBarAppending = false;
MenuBarOffsetX = 0.0f;
MenuBarOffset = ImVec2(0.0f, 0.0f);
StateStorage = NULL;
LayoutType = ParentLayoutType = ImGuiLayoutType_Vertical;
ItemWidth = 0.0f;
@ -1031,7 +1033,7 @@ public:
float CalcFontSize() const { return GImGui->FontBaseSize * FontWindowScale * FontDpiScale; }
float TitleBarHeight() const { return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f; }
ImRect TitleBarRect() const { return ImRect(Pos, ImVec2(Pos.x + SizeFull.x, Pos.y + TitleBarHeight())); }
float MenuBarHeight() const { return (Flags & ImGuiWindowFlags_MenuBar) ? CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f : 0.0f; }
float MenuBarHeight() const { return (Flags & ImGuiWindowFlags_MenuBar) ? DC.MenuBarOffset.y + CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f : 0.0f; }
ImRect MenuBarRect() const { float y1 = Pos.y + TitleBarHeight(); return ImRect(Pos.x, y1, Pos.x + SizeFull.x, y1 + MenuBarHeight()); }
};