Files
yattee/Yattee/Views/RemoteControl/RemoteDevicesSheet.swift
Arkadiusz Fal 9568149c21 Use native text Close button for sheet toolbars on macOS
Sheet dismiss buttons rendered as an iOS-style circular glass "X" on
macOS 26, which looks foreign on the desktop. Add a shared
sheetCloseToolbarItem helper that renders a native text "Close" button
on macOS while keeping the compact icon-only xmark on iOS/tvOS, and
replace the ~14 duplicated inline close buttons across sheets with it.
2026-05-24 12:34:53 +02:00

43 lines
1.1 KiB
Swift

//
// RemoteDevicesSheet.swift
// Yattee
//
// Sheet for quickly accessing remote control devices from Home.
//
import SwiftUI
struct RemoteDevicesSheet: View {
@Environment(\.dismiss) private var dismiss
@State private var selectedDevice: DiscoveredDevice?
var body: some View {
DynamicSheetContainer {
NavigationStack {
RemoteControlContentView(navigationStyle: .selection($selectedDevice))
.navigationTitle(String(localized: "remoteControl.title"))
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
#endif
#if os(macOS)
.frame(minWidth: 400, minHeight: 300)
#endif
.toolbar {
sheetCloseToolbarItem { dismiss() }
}
.navigationDestination(item: $selectedDevice) { device in
RemoteControlView(device: device)
}
}
}
}
}
// MARK: - Preview
#Preview {
RemoteDevicesSheet()
.appEnvironment(.preview)
}