mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-24 00:26:36 +00:00
Viewport: Fixed CTRL+TAB windowing list displaying too many dimming layers (fix dd61c48
for viewport branch)
This commit is contained in:
parent
88df66ec83
commit
d107146687
13
imgui.cpp
13
imgui.cpp
@ -7405,17 +7405,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, all viewports)
|
// Draw modal or window list full viewport dimming background (for other viewports we'll render them in EndFrame)
|
||||||
const bool dim_bg_for_modal = (flags & ImGuiWindowFlags_Modal) && window == GetFrontMostPopupModal() && window->HiddenFrames <= 0;
|
const bool dim_bg_for_modal = (flags & ImGuiWindowFlags_Modal) && window == GetFrontMostPopupModal() && window->HiddenFrames <= 0;
|
||||||
const bool dim_bg_for_window_list = g.NavWindowingTarget && ((window == g.NavWindowingTarget->RootWindow) || (g.NavWindowingList && (window == g.NavWindowingList) && g.NavWindowingList->Viewport != g.NavWindowingTarget->Viewport));
|
const bool dim_bg_for_window_list = g.NavWindowingTarget && ((window == g.NavWindowingTarget->RootWindow) || (g.NavWindowingList && (window == g.NavWindowingList) && g.NavWindowingList->Viewport != g.NavWindowingTarget->Viewport));
|
||||||
if (dim_bg_for_modal || dim_bg_for_window_list)
|
if (dim_bg_for_modal || dim_bg_for_window_list)
|
||||||
for (int viewport_n = 0; viewport_n < g.Viewports.Size; viewport_n++)
|
{
|
||||||
{
|
const ImU32 dim_bg_col = GetColorU32(dim_bg_for_modal ? ImGuiCol_ModalWindowDimBg : ImGuiCol_NavWindowingDimBg, g.DimBgRatio);
|
||||||
ImGuiViewportP* viewport = g.Viewports[viewport_n];
|
window->DrawList->AddRectFilled(viewport_rect.Min, viewport_rect.Max, dim_bg_col);
|
||||||
ImDrawList* draw_list = (viewport == window->Viewport) ? window->DrawList : GetOverlayDrawList(viewport);
|
}
|
||||||
const ImU32 dim_bg_col = GetColorU32(dim_bg_for_modal ? ImGuiCol_ModalWindowDimBg : ImGuiCol_NavWindowingDimBg, g.DimBgRatio);
|
|
||||||
draw_list->AddRectFilled(viewport->Pos, viewport->Pos + viewport->Size, dim_bg_col);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw navigation selection/windowing rectangle background
|
// Draw navigation selection/windowing rectangle background
|
||||||
if (dim_bg_for_window_list && window == g.NavWindowingTarget->RootWindow)
|
if (dim_bg_for_window_list && window == g.NavWindowingTarget->RootWindow)
|
||||||
|
Loading…
Reference in New Issue
Block a user