mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 14:23:40 +01:00
Always show focus indicator if focused
This commit is contained in:
parent
6b875bbcb5
commit
16022ea46a
1 changed files with 11 additions and 4 deletions
|
|
@ -75,14 +75,21 @@ internal sealed partial class ActiveNotification
|
|||
ImGuiWindowFlags.NoFocusOnAppearing |
|
||||
ImGuiWindowFlags.NoDocking);
|
||||
|
||||
var isTakingKeyboardInput = ImGui.IsWindowFocused() && ImGui.GetIO().WantTextInput;
|
||||
var isFocused = ImGui.IsWindowFocused();
|
||||
var isHovered = ImGui.IsWindowHovered(ImGuiHoveredFlags.AllowWhenBlockedByActiveItem);
|
||||
var isTakingKeyboardInput = isFocused && ImGui.GetIO().WantTextInput;
|
||||
var warrantsExtension =
|
||||
this.ExtensionDurationSinceLastInterest > TimeSpan.Zero
|
||||
&& (isHovered || isTakingKeyboardInput);
|
||||
|
||||
this.EffectiveExpiry = this.CalculateEffectiveExpiry(ref warrantsExtension);
|
||||
|
||||
if (!isTakingKeyboardInput && !isHovered && isFocused)
|
||||
{
|
||||
ImGui.SetWindowFocus(null);
|
||||
isFocused = false;
|
||||
}
|
||||
|
||||
if (DateTime.Now > this.EffectiveExpiry)
|
||||
this.DismissNow(NotificationDismissReason.Timeout);
|
||||
|
||||
|
|
@ -105,8 +112,8 @@ internal sealed partial class ActiveNotification
|
|||
ImGui.PopStyleVar();
|
||||
}
|
||||
|
||||
if (isTakingKeyboardInput)
|
||||
this.DrawKeyboardInputIndicator();
|
||||
if (isFocused)
|
||||
this.DrawFocusIndicator();
|
||||
this.DrawExpiryBar(this.EffectiveExpiry, warrantsExtension);
|
||||
|
||||
if (ImGui.IsWindowHovered())
|
||||
|
|
@ -218,7 +225,7 @@ internal sealed partial class ActiveNotification
|
|||
ImGui.PopClipRect();
|
||||
}
|
||||
|
||||
private void DrawKeyboardInputIndicator()
|
||||
private void DrawFocusIndicator()
|
||||
{
|
||||
var windowPos = ImGui.GetWindowPos();
|
||||
var windowSize = ImGui.GetWindowSize();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue