浏览代码

wizard: improve browse path display on iOS

osy 3 年之前
父节点
当前提交
31e1568a83
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      Platform/Shared/FileBrowseField.swift

+ 8 - 3
Platform/Shared/FileBrowseField.swift

@@ -48,9 +48,14 @@ struct FileBrowseField: View {
             }
         }
         #else
-        TextField(titleKey, text: .constant(url?.path ?? ""))
-            .truncationMode(.head)
-            .disabled(true)
+        if let path = url?.path {
+            Text(path)
+                .lineLimit(1)
+                .truncationMode(.head)
+        } else {
+            Text(titleKey)
+                .foregroundColor(.secondary)
+        }
         if hasClearButton {
             Button {
                 url = nil