diff --git a/HellionChat/Configuration.cs b/HellionChat/Configuration.cs index 1b1524b..ae7a9b8 100755 --- a/HellionChat/Configuration.cs +++ b/HellionChat/Configuration.cs @@ -44,6 +44,10 @@ public class Configuration : IPluginConfiguration // Global window opacity, applied across all themes. public float WindowOpacity = 0.85f; + // UI-12: background opacity of the main chat window while unfocused. + // WindowOpacity above stays the focused value. + public float WindowOpacityInactive = 0.65f; + // Reserved for future UI toggles; pre-declared to avoid a migration later. public bool ReduceMotion; @@ -360,6 +364,7 @@ public class Configuration : IPluginConfiguration // v1.1.0 theme engine fields Theme = other.Theme; WindowOpacity = other.WindowOpacity; + WindowOpacityInactive = other.WindowOpacityInactive; ReduceMotion = other.ReduceMotion; UseCompactDensity = other.UseCompactDensity; diff --git a/HellionChat/Ui/ChatLogWindow.cs b/HellionChat/Ui/ChatLogWindow.cs index 072cb5f..227124b 100644 --- a/HellionChat/Ui/ChatLogWindow.cs +++ b/HellionChat/Ui/ChatLogWindow.cs @@ -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(); diff --git a/HellionChat/Ui/SettingsTabs/ThemeAndLayout.cs b/HellionChat/Ui/SettingsTabs/ThemeAndLayout.cs index ccc1e62..f5a9f9e 100644 --- a/HellionChat/Ui/SettingsTabs/ThemeAndLayout.cs +++ b/HellionChat/Ui/SettingsTabs/ThemeAndLayout.cs @@ -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();