Set flags, and unlock size

This commit is contained in:
MidoriKami 2025-11-30 14:47:24 -08:00
parent 2a60bc61a7
commit 2e24696731

View file

@ -457,27 +457,21 @@ public abstract class Window
var flags = this.Flags; var flags = this.Flags;
if (this.internalIsPinned || this.internalIsClickthrough) if (this.internalIsPinned || this.internalIsClickthrough)
{
if (!this.hasError)
{ {
flags |= ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize; flags |= ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize;
} }
else
{
flags &= ~(ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize);
}
}
if (this.internalIsClickthrough) if (this.internalIsClickthrough)
{
if (!this.hasError)
{ {
flags |= ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoNav | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoMouseInputs; flags |= ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoNav | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoMouseInputs;
} }
else
// If we have an error, reset all flags to default, and unlock window size.
if (this.hasError)
{ {
flags &= ~(ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoNav | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoMouseInputs); flags = ImGuiWindowFlags.None;
} ImGui.SetNextWindowCollapsed(false, ImGuiCond.Once);
ImGui.SetNextWindowSizeConstraints(Vector2.Zero, Vector2.PositiveInfinity);
} }
if (this.CanShowCloseButton ? ImGui.Begin(this.WindowName, ref this.internalIsOpen, flags) : ImGui.Begin(this.WindowName, flags)) if (this.CanShowCloseButton ? ImGui.Begin(this.WindowName, ref this.internalIsOpen, flags) : ImGui.Begin(this.WindowName, flags))