Skip to content

Commit a0cf917

Browse files
committed
ux: open previews in new window on macOS when tap to preview is enabled
This is consistent with what the tables do these days.
1 parent 3c04843 commit a0cf917

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

Sushitrain/BrowserListView.swift

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -365,27 +365,23 @@ struct FileEntryLink<Content: View>: View {
365365

366366
private func previewFile() {
367367
#if os(macOS)
368-
// Cmd-click to open preview window directory
369-
if NSEvent.modifierFlags.contains(.command) {
370-
openWindow(
371-
id: "preview",
372-
value: Preview(
373-
folderID: entry.folder!.folderID,
374-
path: entry.path()
375-
))
376-
return
368+
openWindow(
369+
id: "preview",
370+
value: Preview(
371+
folderID: entry.folder!.folderID,
372+
path: entry.path()
373+
))
374+
#else
375+
// Tap to preview local file in QuickLook
376+
if entry.isLocallyPresent(),
377+
let url = entry.localNativeFileURL
378+
{
379+
self.quickLookURL = url
380+
}
381+
else if entry.isStreamable {
382+
self.showPreviewSheet = true
377383
}
378384
#endif
379-
380-
// Tap to preview local file in QuickLook
381-
if entry.isLocallyPresent(),
382-
let url = entry.localNativeFileURL
383-
{
384-
self.quickLookURL = url
385-
}
386-
else if entry.isStreamable {
387-
self.showPreviewSheet = true
388-
}
389385
}
390386

391387
private var inner: some View {

0 commit comments

Comments
 (0)