Apply window opacity to ChildBg as well

The chat log content area is rendered as a child window, so leaving
ChildBg opaque kept the inner pane fully solid even when the slider
was dragged down — defeating the point during combat where the user
wants to see the game behind the chat. Mix the same alpha byte into
ChildBg now. FrameBg and PopupBg are deliberately left opaque so
text inputs, dropdowns, tooltips and modals stay readable on top.
This commit is contained in:
2026-05-01 21:25:13 +02:00
parent 7fdbc81c22
commit 737ec6b868
+7 -4
View File
@@ -115,11 +115,14 @@ internal static class HellionStyle
{ {
var stack = new StackHandle(); var stack = new StackHandle();
// Mix the configured opacity into the window background color. // Mix the configured opacity into both the outer window and the
// Other surface layers (ChildBg, FrameBg, popups) stay opaque so // inner content child backgrounds — without ChildBg following the
// form fields and dialogs remain easy to read on top. // slider the chat log stays opaque inside even when the user
// wants to see the game behind it during combat. Form fields and
// popups (FrameBg, PopupBg) still stay opaque so input is readable.
var alphaByte = (uint)Math.Clamp((int)(windowOpacity * 255f), 0x55, 0xFF); var alphaByte = (uint)Math.Clamp((int)(windowOpacity * 255f), 0x55, 0xFF);
var windowBgWithAlpha = (WindowBgRgba & 0xFFFFFF00u) | alphaByte; var windowBgWithAlpha = (WindowBgRgba & 0xFFFFFF00u) | alphaByte;
var childBgWithAlpha = (ChildBgRgba & 0xFFFFFF00u) | alphaByte;
// Layout — geometric edges, modest rounding, single-pixel borders. // Layout — geometric edges, modest rounding, single-pixel borders.
stack.PushStyleVar(ImGuiStyleVar.WindowRounding, 4f); stack.PushStyleVar(ImGuiStyleVar.WindowRounding, 4f);
@@ -134,7 +137,7 @@ internal static class HellionStyle
// Surfaces. // Surfaces.
stack.PushColor(ImGuiCol.WindowBg, windowBgWithAlpha); stack.PushColor(ImGuiCol.WindowBg, windowBgWithAlpha);
stack.PushColor(ImGuiCol.ChildBg, ChildBgRgba); stack.PushColor(ImGuiCol.ChildBg, childBgWithAlpha);
stack.PushColor(ImGuiCol.PopupBg, PopupBgRgba); stack.PushColor(ImGuiCol.PopupBg, PopupBgRgba);
stack.PushColor(ImGuiCol.Border, BorderRgba); stack.PushColor(ImGuiCol.Border, BorderRgba);
stack.PushColor(ImGuiCol.BorderShadow, BorderShadowRgba); stack.PushColor(ImGuiCol.BorderShadow, BorderShadowRgba);