feat(ui): separate opacity for focused and unfocused chat window
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user