From 0766033e4d11e3ad4fccfb52e70ce9895a38a3ab Mon Sep 17 00:00:00 2001 From: onepiecefreak3 Date: Fri, 17 Nov 2023 23:09:22 +0100 Subject: [PATCH] Set default OpenFileDialog result to Cancel; --- ImGui.Forms/ImGui.Forms.nuspec | 2 +- ImGui.Forms/Modals/IO/OpenFileDialog.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ImGui.Forms/ImGui.Forms.nuspec b/ImGui.Forms/ImGui.Forms.nuspec index e270c0c..23778bc 100644 --- a/ImGui.Forms/ImGui.Forms.nuspec +++ b/ImGui.Forms/ImGui.Forms.nuspec @@ -2,7 +2,7 @@ Imgui.Forms - 1.0.38 + 1.0.39 A WinForms-inspired object-oriented framework around Dear ImGui (https://github.com/ocornut/imgui) onepiecefreak diff --git a/ImGui.Forms/Modals/IO/OpenFileDialog.cs b/ImGui.Forms/Modals/IO/OpenFileDialog.cs index 2e28a2c..7092075 100644 --- a/ImGui.Forms/Modals/IO/OpenFileDialog.cs +++ b/ImGui.Forms/Modals/IO/OpenFileDialog.cs @@ -4,7 +4,6 @@ using System.IO; using System.Linq; using System.Numerics; -using System.Threading.Tasks; using ImGui.Forms.Controls; using ImGui.Forms.Controls.Layouts; using ImGui.Forms.Controls.Lists; @@ -91,6 +90,8 @@ public OpenFileDialog() #endregion + Result = DialogResult.Cancel; + var width = (int)Math.Ceiling(Application.Instance.MainForm.Width * .9f); var height = (int)Math.Ceiling(Application.Instance.MainForm.Height * .8f); Size = new Vector2(width, height); @@ -438,7 +439,7 @@ private void _searchTextBox_TextChanged(object sender, EventArgs e) #endregion - private class FileEntry + class FileEntry { public string Name { get; set; } public string Type { get; set; }