Add ShowCloseButton property to Window to allow hiding the close button. (#906)

This commit is contained in:
Cara 2022-07-01 14:25:39 +09:30 committed by GitHub
parent 47a130b32c
commit 2045aa9228
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,6 +104,11 @@ namespace Dalamud.Interface.Windowing
/// </summary>
public float? BgAlpha { get; set; }
/// <summary>
/// Gets or sets a value indicating whether or not this ImGui window should display a close button in the title bar.
/// </summary>
public bool ShowCloseButton { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether or not this window will stay open.
/// </summary>
@ -236,7 +241,7 @@ namespace Dalamud.Interface.Windowing
ImGui.PushStyleColor(ImGuiCol.TitleBgCollapsed, focusedHeaderColor);
}
if (ImGui.Begin(this.WindowName, ref this.internalIsOpen, this.Flags))
if (this.ShowCloseButton ? ImGui.Begin(this.WindowName, ref this.internalIsOpen, this.Flags) : ImGui.Begin(this.WindowName, this.Flags))
{
// Draw the actual window contents
this.Draw();