소스 검색

Cleaning nameEntry if dirEntry was changing.

BDisp 5 년 전
부모
커밋
ea881b3adf
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      Terminal.Gui/Windows/FileDialog.cs

+ 3 - 1
Terminal.Gui/Windows/FileDialog.cs

@@ -430,7 +430,8 @@ namespace Terminal.Gui {
 
 
 		public string MakePath (string relativePath)
 		public string MakePath (string relativePath)
 		{
 		{
-			return Path.GetFullPath (Path.Combine (Directory.ToString (), relativePath));
+			var dir = Directory.ToString ();
+			return string.IsNullOrEmpty (dir) ? "" : Path.GetFullPath (Path.Combine (dir, relativePath));
 		}
 		}
 
 
 		public IReadOnlyList<string> FilePaths {
 		public IReadOnlyList<string> FilePaths {
@@ -507,6 +508,7 @@ namespace Terminal.Gui {
 				Width = Dim.Fill () - 1,
 				Width = Dim.Fill () - 1,
 				TextChanged = (e) => {
 				TextChanged = (e) => {
 					DirectoryPath = dirEntry.Text;
 					DirectoryPath = dirEntry.Text;
+					nameEntry.Text = ustring.Empty;
 				}
 				}
 			};
 			};
 			Add (dirLabel, dirEntry);
 			Add (dirLabel, dirEntry);