mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-20 14:57:50 +01:00
Make the import popup closeable by clicking outside if it is finished.
This commit is contained in:
parent
22af545e8d
commit
94a05afbe0
2 changed files with 18 additions and 16 deletions
|
|
@ -1,4 +1,6 @@
|
|||
using Dalamud.Game.ClientState.Keys;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Plugin.Services;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
|
|
@ -68,13 +70,16 @@ public sealed class ImportPopup : Window, IUiService
|
|||
ImGui.SetNextWindowSize(size);
|
||||
using var popup = ImRaii.Popup(importPopup, ImGuiWindowFlags.Modal);
|
||||
PopupWasDrawn = true;
|
||||
var terminate = false;
|
||||
using (var child = ImRaii.Child("##import", new Vector2(-1, size.Y - ImGui.GetFrameHeight() * 2)))
|
||||
{
|
||||
if (child)
|
||||
import.DrawProgressInfo(new Vector2(-1, ImGui.GetFrameHeight()));
|
||||
if (child.Success && import.DrawProgressInfo(new Vector2(-1, ImGui.GetFrameHeight())))
|
||||
if (!ImGui.IsMouseHoveringRect(ImGui.GetWindowPos(), ImGui.GetWindowPos() + ImGui.GetWindowSize())
|
||||
&& ImGui.IsMouseClicked(ImGuiMouseButton.Left))
|
||||
terminate = true;
|
||||
}
|
||||
|
||||
var terminate = import.State == ImporterState.Done
|
||||
terminate |= import.State == ImporterState.Done
|
||||
? ImGui.Button("Close", -Vector2.UnitX)
|
||||
: import.DrawCancelButton(-Vector2.UnitX);
|
||||
if (terminate)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue