mirror of
https://github.com/nimbold/Firelink.git
synced 2026-07-27 04:19:19 +00:00
fix: media download UX and table row selection
- Fix: Remove aria2c from yt-dlp to allow native concurrent downloader to print progress - Fix: Use generic 'Fetching media data...' message instead of hardcoding YouTube - Fix: Remove onTapGesture from Table cells to restore native macOS SwiftUI row selection and use simultaneousGesture on the Table itself for double clicks
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import re
|
||||
|
||||
with open("Sources/Firelink/DownloadTable.swift", "r") as f:
|
||||
content = f.read()
|
||||
|
||||
# Remove doubleClickableCell block
|
||||
content = re.sub(r' private func doubleClickableCell.*? }\n\n', '', content, flags=re.DOTALL)
|
||||
|
||||
# Remove doubleClickableCell wrappers from TableColumn
|
||||
content = re.sub(r'doubleClickableCell\(for: item\) \{\n\s*(.*?)\n\s*\}', r'\1', content, flags=re.DOTALL)
|
||||
|
||||
# Add simultaneousGesture to Table
|
||||
table_end = content.find(' .environment(\\.defaultMinListRowHeight, settings.listRowDensity.minRowHeight)')
|
||||
gesture = ''' .simultaneousGesture(TapGesture(count: 2).onEnded {
|
||||
if let id = selection.first, let item = controller.downloads.first(where: { $0.id == id }) {
|
||||
performPrimaryAction(for: item)
|
||||
}
|
||||
})
|
||||
'''
|
||||
content = content[:table_end] + gesture + content[table_end:]
|
||||
|
||||
with open("Sources/Firelink/DownloadTable.swift", "w") as f:
|
||||
f.write(content)
|
||||
Reference in New Issue
Block a user