Skip to content

Commit

Permalink
ContentView // Allow double-clicking in the table.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShikiSuen committed Nov 9, 2023
1 parent a2e4830 commit 4d4a19f
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions IMRemoval/Sources/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,23 @@ struct ContentView: View {
} else {
AnyView(EmptyView())
}
thisLine.bundleIcon
thisLine.bundleIcon.onTapGesture(count: 2) {
NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: thisLine.path)])
}
}
}.width(42)
TableColumn("i18n:fieldName.imeTitle", value: \.title).width(170)
TableColumn("i18n:fieldName.imeBundlePath.public", value: \.path)
TableColumn("i18n:fieldName.imeTitle", value: \.title) { thisLine in
let url = URL(fileURLWithPath: thisLine.path)
Text(thisLine.title).onTapGesture(count: 2) {
NSWorkspace.shared.activateFileViewerSelecting([url])
}
}.width(170)
TableColumn("i18n:fieldName.imeBundlePath.public", value: \.path) { thisLine in
let url = URL(fileURLWithPath: thisLine.path)
Text(thisLine.path).onTapGesture(count: 2) {
NSWorkspace.shared.activateFileViewerSelecting([url])
}
}
}.frame(minHeight: 200)
Table(viewModel.userBundles, selection: $highlightedUser, sortOrder: $sortOrder) {
TableColumn(" ", value: \.ticked, comparator: BoolComparator()) { thisLine in
Expand All @@ -69,11 +81,23 @@ struct ContentView: View {
} else {
AnyView(EmptyView())
}
thisLine.bundleIcon
thisLine.bundleIcon.onTapGesture(count: 2) {
NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: thisLine.path)])
}
}
}.width(42)
TableColumn("i18n:fieldName.imeTitle", value: \.title).width(170)
TableColumn("i18n:fieldName.imeBundlePath.currentUser", value: \.path)
TableColumn("i18n:fieldName.imeTitle", value: \.title) { thisLine in
let url = URL(fileURLWithPath: thisLine.path)
Text(thisLine.title).onTapGesture(count: 2) {
NSWorkspace.shared.activateFileViewerSelecting([url])
}
}.width(170)
TableColumn("i18n:fieldName.imeBundlePath.currentUser", value: \.path) { thisLine in
let url = URL(fileURLWithPath: thisLine.path)
Text(thisLine.path).onTapGesture(count: 2) {
NSWorkspace.shared.activateFileViewerSelecting([url])
}
}
}.frame(minHeight: 100)
}
.font(.system(.body).monospacedDigit())
Expand Down

0 comments on commit 4d4a19f

Please sign in to comment.