From 339009a2fcaf9a649c4fef70bc49674934cf62b0 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 17 Oct 2021 19:47:55 -0400 Subject: [PATCH] Apply TitleBgActive coloring when minimized and focused Window-System applicable only --- Dalamud/Interface/Windowing/Window.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Dalamud/Interface/Windowing/Window.cs b/Dalamud/Interface/Windowing/Window.cs index 1ad7afdbd..f173f8256 100644 --- a/Dalamud/Interface/Windowing/Window.cs +++ b/Dalamud/Interface/Windowing/Window.cs @@ -193,12 +193,25 @@ namespace Dalamud.Interface.Windowing this.OnOpen(); } + var wasFocused = this.IsFocused; + if (wasFocused) + { + var style = ImGui.GetStyle(); + var focusedHeaderColor = style.Colors[(int)ImGuiCol.TitleBgActive]; + ImGui.PushStyleColor(ImGuiCol.TitleBgCollapsed, focusedHeaderColor); + } + if (ImGui.Begin(this.WindowName, ref this.internalIsOpen, this.Flags)) { // Draw the actual window contents this.Draw(); } + if (wasFocused) + { + ImGui.PopStyleColor(); + } + this.IsFocused = ImGui.IsWindowFocused(ImGuiFocusedFlags.RootAndChildWindows); var escapeDown = Service.Get()[VirtualKey.ESCAPE];