feat(ui): separate opacity for focused and unfocused chat window

This commit is contained in:
2026-05-22 15:03:56 +02:00
parent 921dd701c4
commit d05770fd6d
3 changed files with 32 additions and 1 deletions
+9 -1
View File
@@ -709,7 +709,15 @@ public sealed class ChatLogWindow : Window
// Window-Deckkraft eingestellt hat, hat dieses Per-Window-Override
// Vorrang über unseren Slider — wir dokumentieren das im HelpMarker.
if (LastViewport == ImGuiHelpers.MainViewport.Handle && !WasDocked)
BgAlpha = Plugin.Config.WindowOpacity;
{
// UI-12: focus-dependent opacity. PreOpenCheck runs before Begin();
// Window.IsFocused holds last frame's RootAndChildWindows focus, set
// by Dalamud's WindowHost after Begin(). One-frame latency is
// accepted.
BgAlpha = IsFocused
? Plugin.Config.WindowOpacity
: Plugin.Config.WindowOpacityInactive;
}
LastViewport = ImGui.GetWindowViewport().Handle;
WasDocked = ImGui.IsWindowDocked();
@@ -296,6 +296,24 @@ internal sealed class ThemeAndLayout : ISettingsTab
}
ImGuiUtil.HelpMarker(HellionStrings.Settings_ThemeAndLayout_WindowOpacity_Description);
// UI-12: inactive-window opacity, same 50-100% range and clamp.
var inactiveOpacityPercent = Mutable.WindowOpacityInactive * 100f;
if (
ImGuiUtil.DragFloatVertical(
HellionStrings.Settings_ThemeAndLayout_WindowOpacityInactive_Name,
ref inactiveOpacityPercent,
.25f,
50f,
100f,
$"{inactiveOpacityPercent:N0}%%",
ImGuiSliderFlags.AlwaysClamp
)
)
{
Mutable.WindowOpacityInactive = inactiveOpacityPercent / 100f;
}
ImGuiUtil.HelpMarker(HellionStrings.Settings_ThemeAndLayout_WindowOpacityInactive_Description);
ImGui.Spacing();
ImGui.Separator();
ImGui.Spacing();