Skip to content

Commit 5dd097d

Browse files
authored
Pinning window disables close on escape key down (#2178)
* Pinning window disables close on escape key down * Update tooltip for window pinning
1 parent af1ddf5 commit 5dd097d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: Dalamud/Interface/Windowing/Window.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Runtime.InteropServices;
77

88
using CheapLoc;
9+
910
using Dalamud.Game.ClientState.Keys;
1011
using Dalamud.Interface.Colors;
1112
using Dalamud.Interface.Components;
@@ -15,7 +16,9 @@
1516
using Dalamud.Logging.Internal;
1617

1718
using FFXIVClientStructs.FFXIV.Client.UI;
19+
1820
using ImGuiNET;
21+
1922
using PInvoke;
2023

2124
namespace Dalamud.Interface.Windowing;
@@ -429,7 +432,7 @@ internal void DrawInternal(WindowDrawFlags internalDrawFlags, WindowSystemPersis
429432
}
430433

431434
ImGuiComponents.HelpMarker(
432-
Loc.Localize("WindowSystemContextActionPinHint", "Pinned windows will not move or resize when you click and drag them."));
435+
Loc.Localize("WindowSystemContextActionPinHint", "Pinned windows will not move or resize when you click and drag them, nor will they close when escape is pressed."));
433436
}
434437

435438
if (this.internalIsClickthrough)
@@ -521,7 +524,7 @@ internal void DrawInternal(WindowDrawFlags internalDrawFlags, WindowSystemPersis
521524

522525
this.IsFocused = ImGui.IsWindowFocused(ImGuiFocusedFlags.RootAndChildWindows);
523526

524-
if (internalDrawFlags.HasFlag(WindowDrawFlags.UseFocusManagement))
527+
if (internalDrawFlags.HasFlag(WindowDrawFlags.UseFocusManagement) && !this.internalIsPinned)
525528
{
526529
var escapeDown = Service<KeyState>.Get()[VirtualKey.ESCAPE];
527530
if (escapeDown && this.IsFocused && !wasEscPressedLastFrame && this.RespectCloseHotkey)
@@ -701,7 +704,7 @@ bool DrawButton(TitleBarButton button, Vector2 pos)
701704
drawList.AddCircleFilled(GetCenter(bb) + new Vector2(0.0f, -0.5f), (fontSize * 0.5f) + 1.0f, bgCol);
702705

703706
var offset = button.IconOffset * ImGuiHelpers.GlobalScale;
704-
drawList.AddText(InterfaceManager.IconFont, (float)(fontSize * 0.8), new Vector2(bb.X + offset.X, bb.Y + offset.Y), textCol, button.Icon.ToIconString());
707+
drawList.AddText(InterfaceManager.IconFont, (float)(fontSize * 0.8), new Vector2(bb.X + offset.X, bb.Y + offset.Y), textCol, button.Icon.ToIconString());
705708

706709
if (hovered)
707710
button.ShowTooltip?.Invoke();

0 commit comments

Comments
 (0)