mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-19 22:37:43 +01:00
Pinning window disables close on escape key down (#2178)
* Pinning window disables close on escape key down * Update tooltip for window pinning
This commit is contained in:
parent
af1ddf5bfb
commit
5dd097d72b
1 changed files with 6 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ using System.Numerics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
using CheapLoc;
|
using CheapLoc;
|
||||||
|
|
||||||
using Dalamud.Game.ClientState.Keys;
|
using Dalamud.Game.ClientState.Keys;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Components;
|
using Dalamud.Interface.Components;
|
||||||
|
|
@ -15,7 +16,9 @@ using Dalamud.Interface.Windowing.Persistence;
|
||||||
using Dalamud.Logging.Internal;
|
using Dalamud.Logging.Internal;
|
||||||
|
|
||||||
using FFXIVClientStructs.FFXIV.Client.UI;
|
using FFXIVClientStructs.FFXIV.Client.UI;
|
||||||
|
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
|
|
||||||
using PInvoke;
|
using PInvoke;
|
||||||
|
|
||||||
namespace Dalamud.Interface.Windowing;
|
namespace Dalamud.Interface.Windowing;
|
||||||
|
|
@ -429,7 +432,7 @@ public abstract class Window
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGuiComponents.HelpMarker(
|
ImGuiComponents.HelpMarker(
|
||||||
Loc.Localize("WindowSystemContextActionPinHint", "Pinned windows will not move or resize when you click and drag them."));
|
Loc.Localize("WindowSystemContextActionPinHint", "Pinned windows will not move or resize when you click and drag them, nor will they close when escape is pressed."));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.internalIsClickthrough)
|
if (this.internalIsClickthrough)
|
||||||
|
|
@ -521,7 +524,7 @@ public abstract class Window
|
||||||
|
|
||||||
this.IsFocused = ImGui.IsWindowFocused(ImGuiFocusedFlags.RootAndChildWindows);
|
this.IsFocused = ImGui.IsWindowFocused(ImGuiFocusedFlags.RootAndChildWindows);
|
||||||
|
|
||||||
if (internalDrawFlags.HasFlag(WindowDrawFlags.UseFocusManagement))
|
if (internalDrawFlags.HasFlag(WindowDrawFlags.UseFocusManagement) && !this.internalIsPinned)
|
||||||
{
|
{
|
||||||
var escapeDown = Service<KeyState>.Get()[VirtualKey.ESCAPE];
|
var escapeDown = Service<KeyState>.Get()[VirtualKey.ESCAPE];
|
||||||
if (escapeDown && this.IsFocused && !wasEscPressedLastFrame && this.RespectCloseHotkey)
|
if (escapeDown && this.IsFocused && !wasEscPressedLastFrame && this.RespectCloseHotkey)
|
||||||
|
|
@ -701,7 +704,7 @@ public abstract class Window
|
||||||
drawList.AddCircleFilled(GetCenter(bb) + new Vector2(0.0f, -0.5f), (fontSize * 0.5f) + 1.0f, bgCol);
|
drawList.AddCircleFilled(GetCenter(bb) + new Vector2(0.0f, -0.5f), (fontSize * 0.5f) + 1.0f, bgCol);
|
||||||
|
|
||||||
var offset = button.IconOffset * ImGuiHelpers.GlobalScale;
|
var offset = button.IconOffset * ImGuiHelpers.GlobalScale;
|
||||||
drawList.AddText(InterfaceManager.IconFont, (float)(fontSize * 0.8), new Vector2(bb.X + offset.X, bb.Y + offset.Y), textCol, button.Icon.ToIconString());
|
drawList.AddText(InterfaceManager.IconFont, (float)(fontSize * 0.8), new Vector2(bb.X + offset.X, bb.Y + offset.Y), textCol, button.Icon.ToIconString());
|
||||||
|
|
||||||
if (hovered)
|
if (hovered)
|
||||||
button.ShowTooltip?.Invoke();
|
button.ShowTooltip?.Invoke();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue