Improve fileURL display in document inspector

This commit is contained in:
1024jp 2024-05-27 18:38:13 +09:00
parent 27fd054ff2
commit 51f73059fa
2 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,11 @@
4.8.5 (unreleased)
--------------------------
### Improvements
- Improve the file path display in the document inspector.
### Fixes
- Fix an issue that the application crashed by opening the Appearance settings pane when the font the user set did not exist.

View File

@ -152,9 +152,12 @@ private struct DocumentFileView: View {
LabeledContent(String(localized: "Full Path", table: "Document", comment: "label in document inspector")) {
if let fileURL = self.fileURL {
HStack(alignment: .lastTextBaseline, spacing: 0) {
Text(fileURL, format: .url)
Text(fileURL, format: .url.scheme(.never))
.lineLimit(5)
.truncationMode(.middle)
.textSelection(.enabled)
.foregroundStyle(.primary)
.help(fileURL.formatted(.url.scheme(.never)))
Button(String(localized: "Show in Finder", table: "Document"), systemImage: "arrow.forward") {
NSWorkspace.shared.activateFileViewerSelecting([fileURL])
}