Add Show in Finder button in document inspector (close #1145)

This commit is contained in:
1024jp 2024-05-10 22:47:19 +09:00
parent e770f0ad4a
commit ba86581a75
5 changed files with 121 additions and 3 deletions

View File

@ -3,6 +3,11 @@
4.8.3 (unreleased)
--------------------------
### New Features
- Add the “Show in Finder” button next to the file path in the document inspector.
### Improvements
- Display the current editor mode in the document inspector.

View File

@ -23,6 +23,15 @@
</header>
<section>
<h2>New Features</h2>
<ul>
<li>Add the “Show in Finder” button next to the file path in the document inspector.</li>
</ul>
</section>
<section>
<h2>Improvements</h2>

View File

@ -23,6 +23,15 @@
</header>
<section>
<h2>新機能</h2>
<ul>
<li>書類インスペクタのファイルパスの横に「Finderに表示」ボタンを追加</li>
</ul>
</section>
<section>
<h2>改良</h2>

View File

@ -3752,6 +3752,82 @@
}
}
},
"Show in Finder" : {
"localizations" : {
"cs" : {
"stringUnit" : {
"state" : "translated",
"value" : "Zobrazit ve Finderu"
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Im Finder zeigen"
}
},
"en-GB" : {
"stringUnit" : {
"state" : "translated",
"value" : "Show in Finder"
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "Mostrar en el Finder"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Afficher dans le Finder"
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "Mostra nel Finder"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "Finderに表示"
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
"value" : "Toon in Finder"
}
},
"pt" : {
"stringUnit" : {
"state" : "translated",
"value" : "Mostrar no Finder"
}
},
"tr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Finderda Göster"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "在访达中显示"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "顯示於Finder"
}
}
}
},
"Size" : {
"comment" : "label in document inspector",
"localizations" : {

View File

@ -148,9 +148,28 @@ private struct DocumentFileView: View {
OptionalLabeledContent(String(localized: "Owner", table: "Document",
comment: "label in document inspector"),
value: self.attributes?.owner)
OptionalLabeledContent(String(localized: "Full Path", table: "Document",
comment: "label in document inspector"),
value: self.fileURL?.path)
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)
.textSelection(.enabled)
.foregroundStyle(.primary)
Button(String(localized: "Show in Finder", table: "Document"), systemImage: "arrow.forward") {
NSWorkspace.shared.activateFileViewerSelecting([fileURL])
}
.symbolVariant(.circle)
.symbolVariant(.fill)
.fontWeight(.bold)
.labelStyle(.iconOnly)
.controlSize(.mini)
.buttonStyle(.borderless)
}
} else {
Text(verbatim: "")
.foregroundStyle(.tertiary)
}
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}