Browse Source

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

miguel 6 years ago
parent
commit
7c1bfd5e8a
2 changed files with 3 additions and 1 deletions
  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");
 		var d = new OpenDialog ("Open", "Open a file");
 		Application.Run (d);
 		Application.Run (d);
+
+		MessageBox.Query (50, 7, "Selected File", string.Join (", ", d.FilePaths), "ok");
 	}
 	}
 
 
 	public static void ShowHex (Toplevel top)
 	public static void ShowHex (Toplevel top)

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

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