mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 14:22:02 +00:00
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.
43 lines
1.1 KiB
Swift
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)
|
|
}
|