Skip to content

Commit

Permalink
fix the bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jupahe64 committed Jan 5, 2024
1 parent 57a0f51 commit a69e3a6
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions Fushigi/ui/widgets/OperationWarningDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static async Task<DialogResult> ShowDialog(IPopupModalHost modalHost,
{
var result = await modalHost.ShowPopUp(
new OperationWarningDialog(warning, categorizedWarnings),
title, ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoBringToFrontOnFocus);
title, ImGuiWindowFlags.AlwaysAutoResize);

if (result.wasClosed)
return DialogResult.Cancel;
Expand All @@ -43,12 +43,8 @@ public void DrawModalContent(Promise<DialogResult> promise)
float width = ImGui.GetContentRegionAvail().X;
ImGui.SetNextWindowSizeConstraints(new Vector2(width, 0),
new Vector2(width, ImGui.GetWindowViewport().WorkSize.Y / 3f));
ImGui.SetNextWindowPos(ImGui.GetCursorScreenPos());
ImGui.PushStyleVar(ImGuiStyleVar.WindowBorderSize, 0);
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(0));
var cursorPos = ImGui.GetCursorPos();
if (ImGui.Begin("CategorizedWarnings",
ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoNavFocus))
if(ImGui.BeginChild("Categorized", Vector2.Zero, ImGuiChildFlags.AutoResizeY))
{
var headerStickPosY = 0f;
foreach (var (category, warnings) in mCategorizedWarnings)
Expand All @@ -72,7 +68,7 @@ public void DrawModalContent(Promise<DialogResult> promise)
if(!expanded)
continue;

ImGui.PushClipRect(ImGui.GetCursorScreenPos(),
ImGui.PushClipRect(ImGui.GetCursorScreenPos(),
new Vector2(float.PositiveInfinity), true);

headerStickPosY = ImGui.GetCursorPosY() - ImGui.GetScrollY();
Expand All @@ -87,13 +83,9 @@ public void DrawModalContent(Promise<DialogResult> promise)
}
ImGui.Unindent();
ImGui.PopClipRect();
ImGui.SetWindowSize(new Vector2(100, 100));
}
cursorPos += ImGui.GetWindowSize() with { X = 0 };
ImGui.End();
ImGui.EndChild();
}
ImGui.PopStyleVar(2);
ImGui.SetCursorPos(cursorPos);
#endregion


Expand Down

0 comments on commit a69e3a6

Please sign in to comment.