mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 10:25:02 +00:00
Make media browser file list feel native on macOS
Drop the iOS-grouped rounded card in MediaBrowserView's section container for top/bottom dividers on macOS, force .buttonStyle(.plain) on directory NavigationLinks to avoid default link tinting, and shrink MediaFileRow's icon frame on macOS. iOS and tvOS unchanged.
This commit is contained in:
@@ -222,7 +222,11 @@ struct MediaBrowserView: View {
|
||||
NavigationLink(value: NavigationDestination.mediaBrowser(source, path: file.path, showOnlyPlayable: showOnlyPlayable)) {
|
||||
MediaFileRow(file: file, sortOrder: sortOrder)
|
||||
}
|
||||
#if os(macOS)
|
||||
.buttonStyle(.plain)
|
||||
#else
|
||||
.foregroundStyle(.primary)
|
||||
#endif
|
||||
} else if file.isPlayable {
|
||||
playableFileRow(for: file)
|
||||
} else {
|
||||
@@ -275,6 +279,16 @@ struct MediaBrowserView: View {
|
||||
|
||||
@ViewBuilder
|
||||
private func sectionCard<Content: View>(@ViewBuilder content: () -> Content) -> some View {
|
||||
#if os(macOS)
|
||||
VStack(spacing: 0) {
|
||||
Divider()
|
||||
LazyVStack(spacing: 0) {
|
||||
content()
|
||||
}
|
||||
Divider()
|
||||
}
|
||||
.padding(.bottom, 12)
|
||||
#else
|
||||
if listStyle == .inset {
|
||||
LazyVStack(spacing: 0) {
|
||||
content()
|
||||
@@ -289,6 +303,7 @@ struct MediaBrowserView: View {
|
||||
}
|
||||
.padding(.bottom, 16)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// MARK: - Preferences
|
||||
|
||||
@@ -56,11 +56,19 @@ struct MediaFileRow: View {
|
||||
}
|
||||
|
||||
private var iconView: some View {
|
||||
#if os(macOS)
|
||||
Image(systemName: file.systemImage)
|
||||
.font(.title3)
|
||||
.foregroundStyle(iconColor)
|
||||
.frame(width: 28, height: 28)
|
||||
.contentShape(Rectangle())
|
||||
#else
|
||||
Image(systemName: file.systemImage)
|
||||
.font(.title2)
|
||||
.foregroundStyle(iconColor)
|
||||
.frame(width: 44, height: 44)
|
||||
.contentShape(Rectangle())
|
||||
#endif
|
||||
}
|
||||
|
||||
private var textView: some View {
|
||||
|
||||
Reference in New Issue
Block a user