PrefUI // Alt+Ellipsis button to use Finder to open paths.

This commit is contained in:
ShikiSuen 2023-07-29 22:58:52 +08:00
parent fd4bc39032
commit 100a16a9e6
2 changed files with 12 additions and 0 deletions

View File

@ -49,6 +49,12 @@ struct VwrPrefPaneCassette: View {
TextField(fdrCassetteDataDefault, text: $cassettePath).disabled(true)
.help(cassettePath)
Button {
if NSEvent.modifierFlags == .option, !cassettePath.isEmpty {
NSWorkspace.shared.activateFileViewerSelecting(
[URL(fileURLWithPath: cassettePath)]
)
return
}
Self.dlgOpenFile.title = NSLocalizedString(
"Choose your desired cassette file path.", comment: ""
)

View File

@ -63,6 +63,12 @@ struct VwrPrefPaneDictionary: View {
TextField(fdrUserDataDefault, text: $userDataFolderSpecified).disabled(true)
.help(userDataFolderSpecified)
Button {
if NSEvent.modifierFlags == .option, !userDataFolderSpecified.isEmpty {
NSWorkspace.shared.activateFileViewerSelecting(
[URL(fileURLWithPath: userDataFolderSpecified)]
)
return
}
Self.dlgOpenPath.title = NSLocalizedString(
"Choose your desired user data folder.", comment: ""
)