Browse Source

Fixed title bar background alpha being used to render viewport-owned windows. (#7184, #7181)

David Maas 1 year ago
parent
commit
2523c197bc
2 changed files with 3 additions and 0 deletions
  1. 1 0
      docs/CHANGELOG.txt
  2. 2 0
      imgui.cpp

+ 1 - 0
docs/CHANGELOG.txt

@@ -97,6 +97,7 @@ Docking+Viewports Branch:
 
 
 - Backends: DX12: Changed swapchain scaling mode to DXGI_SCALING_NONE to reduce artifacts as
 - Backends: DX12: Changed swapchain scaling mode to DXGI_SCALING_NONE to reduce artifacts as
   queued frames aren't synchronized with platform window resizes. (#7152, #7153) [@SuperWangKai]
   queued frames aren't synchronized with platform window resizes. (#7152, #7153) [@SuperWangKai]
+- Windows: Fixed ImGuiCol_TitleBg/Active alpha being used for viewport-owned windows. (#7181) [@PathogenDavid]
 
 
 
 
 -----------------------------------------------------------------------
 -----------------------------------------------------------------------

+ 2 - 0
imgui.cpp

@@ -6492,6 +6492,8 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
         if (!(flags & ImGuiWindowFlags_NoTitleBar) && !window->DockIsActive)
         if (!(flags & ImGuiWindowFlags_NoTitleBar) && !window->DockIsActive)
         {
         {
             ImU32 title_bar_col = GetColorU32(title_bar_is_highlight ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBg);
             ImU32 title_bar_col = GetColorU32(title_bar_is_highlight ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBg);
+            if (window->ViewportOwned)
+                title_bar_col |= IM_COL32_A_MASK; // No alpha
             window->DrawList->AddRectFilled(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, window_rounding, ImDrawFlags_RoundCornersTop);
             window->DrawList->AddRectFilled(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, window_rounding, ImDrawFlags_RoundCornersTop);
         }
         }