瀏覽代碼

Fix layout for FileDialog, example shows how to retrieve the file

miguel 6 年之前
父節點
當前提交
7c1bfd5e8a
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 2 0
      Example/demo.cs
  2. 1 1
      Terminal.Gui/Dialogs/FileDialog.cs

+ 2 - 0
Example/demo.cs

@@ -216,6 +216,8 @@ static class Demo {
 	{
 		var d = new OpenDialog ("Open", "Open a file");
 		Application.Run (d);
+
+		MessageBox.Query (50, 7, "Selected File", string.Join (", ", d.FilePaths), "ok");
 	}
 
 	public static void ShowHex (Toplevel top)

+ 1 - 1
Terminal.Gui/Dialogs/FileDialog.cs

@@ -309,7 +309,7 @@ namespace Terminal.Gui {
 			dirListView = new DirListView () {
 				X = 1,
 				Y = 3 + msgLines + 2,
-				Width = Dim.Fill (),
+				Width = Dim.Fill () - 2,
 				Height = Dim.Fill () - 2,
 			};
 			DirectoryPath = Path.GetFullPath (Environment.CurrentDirectory);