Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Platform/iOS/VMToolbarUSBMenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ struct VMToolbarUSBMenuView: View {
} label: {
if session.isUsbBusy {
Spinner(size: .regular)
} else if #available(iOS 15, macOS 12, visionOS 1, *) {
// cable.connector ships in SF Symbols 3, so it matches the
// stroke weight and sizing of the surrounding toolbar items.
Label("USB", systemImage: "cable.connector")
} else {
Label("USB", image: "Toolbar USB")
}
Expand Down
14 changes: 13 additions & 1 deletion Platform/macOS/Display/VMDisplayWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,27 @@ class VMDisplayWindowController: NSWindowController, UTMVirtualMachineDelegate {
window!.recalculateKeyViewLoop()
setupStopButtonMenu()
setupMainMenu()
setupToolbarIcons()

if vm.state == .stopped {
enterSuspended(isBusy: false)
} else {
enterLive()
}

super.windowDidLoad()
}

private func setupToolbarIcons() {
// cable.connector ships in SF Symbols 3 (macOS 12+); use it so the
// USB toolbar item visually matches the surrounding system symbols.
// Older systems fall back to the bundled "Toolbar USB" template
// image from the nib.
if #available(macOS 12, *) {
usbToolbarItem.image = NSImage(systemSymbolName: "cable.connector",
accessibilityDescription: usbToolbarItem.label)
}
}

public func requestAutoStart(options: UTMVirtualMachineStartOptions = []) {
guard shouldAutoStartVM else {
Expand Down