mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 13:08:47 +02:00
Viewports, Docking: Added per-viewport work area system for e.g. menu-bars. Fixed DocksapceOverViewport() and demo code (overlay etc) (#3035, #2889, #2474, #1542, #2109)
Clarified that BeginMenuMainBar() had an incorrect knowledge of its height (which was previously harmless). Designed to easily allow for status bars although we don't have/use them yet, but custom code could use them.
This commit is contained in:
@ -934,10 +934,13 @@ struct ImGuiViewportP : public ImGuiViewport
|
||||
ImVec2 LastPlatformPos;
|
||||
ImVec2 LastPlatformSize;
|
||||
ImVec2 LastRendererSize;
|
||||
ImVec2 CurrWorkOffsetMin; // Work area top-left offset being increased during the frame
|
||||
ImVec2 CurrWorkOffsetMax; // Work area bottom-right offset being decreased during the frame
|
||||
|
||||
ImGuiViewportP() { Idx = -1; LastFrameActive = LastFrameDrawLists[0] = LastFrameDrawLists[1] = LastFrontMostStampCount = -1; LastNameHash = 0; Alpha = LastAlpha = 1.0f; PlatformMonitor = -1; PlatformWindowCreated = false; Window = NULL; DrawLists[0] = DrawLists[1] = NULL; LastPlatformPos = LastPlatformSize = LastRendererSize = ImVec2(FLT_MAX, FLT_MAX); }
|
||||
~ImGuiViewportP() { if (DrawLists[0]) IM_DELETE(DrawLists[0]); if (DrawLists[1]) IM_DELETE(DrawLists[1]); }
|
||||
ImRect GetMainRect() const { return ImRect(Pos.x, Pos.y, Pos.x + Size.x, Pos.y + Size.y); }
|
||||
ImRect GetWorkRect() const { return ImRect(Pos.x + WorkOffsetMin.x, Pos.y + WorkOffsetMin.y, Pos.x + Size.x + WorkOffsetMax.x, Pos.y + Size.y + WorkOffsetMax.y); }
|
||||
void ClearRequestFlags() { PlatformRequestClose = PlatformRequestMove = PlatformRequestResize = false; }
|
||||
};
|
||||
|
||||
@ -991,7 +994,7 @@ struct ImGuiNextWindowData
|
||||
ImGuiID ViewportId;
|
||||
ImGuiID DockId;
|
||||
ImGuiWindowClass WindowClass;
|
||||
ImVec2 MenuBarOffsetMinVal; // *Always on* This is not exposed publicly, so we don't clear it.
|
||||
ImVec2 MenuBarOffsetMinVal; // (Always on) This is not exposed publicly, so we don't clear it and it doesn't have a corresponding flag (could we? for consistency?)
|
||||
|
||||
ImGuiNextWindowData() { memset(this, 0, sizeof(*this)); }
|
||||
inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
|
||||
|
Reference in New Issue
Block a user