mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Add Show in Finder button in document inspector (close #1145)
This commit is contained in:
parent
e770f0ad4a
commit
ba86581a75
@ -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.
|
||||
|
@ -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>
|
||||
|
||||
|
@ -23,6 +23,15 @@
|
||||
</header>
|
||||
|
||||
|
||||
<section>
|
||||
<h2>新機能</h2>
|
||||
|
||||
<ul>
|
||||
<li>書類インスペクタのファイルパスの横に「Finderに表示」ボタンを追加</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
<section>
|
||||
<h2>改良</h2>
|
||||
|
||||
|
@ -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" : "Finder’da Göster"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "在访达中显示"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "顯示於Finder"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Size" : {
|
||||
"comment" : "label in document inspector",
|
||||
"localizations" : {
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user