mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-24 00:26:36 +00:00
Viewport: Modal display their darkneing/whitening layer over all viewports. (#1542)
This commit is contained in:
parent
25fd9d6132
commit
21ff03978a
@ -6515,9 +6515,14 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
else
|
else
|
||||||
PushClipRect(viewport_rect.Min, viewport_rect.Max, true);
|
PushClipRect(viewport_rect.Min, viewport_rect.Max, true);
|
||||||
|
|
||||||
// Draw modal window background (darkens what is behind them)
|
// Draw modal window background (darkens what is behind them, all viewports)
|
||||||
if ((flags & ImGuiWindowFlags_Modal) != 0 && window == GetFrontMostModalRootWindow())
|
if ((flags & ImGuiWindowFlags_Modal) != 0 && window == GetFrontMostModalRootWindow() && window->HiddenFrames <= 0)
|
||||||
|
{
|
||||||
window->DrawList->AddRectFilled(viewport_rect.Min, viewport_rect.Max, GetColorU32(ImGuiCol_ModalWindowDarkening, g.ModalWindowDarkeningRatio));
|
window->DrawList->AddRectFilled(viewport_rect.Min, viewport_rect.Max, GetColorU32(ImGuiCol_ModalWindowDarkening, g.ModalWindowDarkeningRatio));
|
||||||
|
for (int viewport_n = 0; viewport_n < g.Viewports.Size; viewport_n++)
|
||||||
|
if (g.Viewports[viewport_n] != window->Viewport)
|
||||||
|
g.OverlayDrawList.AddRectFilled(g.Viewports[viewport_n]->Pos, g.Viewports[viewport_n]->Pos + g.Viewports[viewport_n]->Size, GetColorU32(ImGuiCol_ModalWindowDarkening, g.ModalWindowDarkeningRatio));
|
||||||
|
}
|
||||||
|
|
||||||
// Draw navigation selection/windowing rectangle background
|
// Draw navigation selection/windowing rectangle background
|
||||||
if (g.NavWindowingTarget == window)
|
if (g.NavWindowingTarget == window)
|
||||||
|
Loading…
Reference in New Issue
Block a user