minivmac4ios/Mini vMac/PowerMenu.swift
2024-02-10 14:52:06 +01:00

34 lines
876 B
Swift

//
// PowerMenu.swift
// Mini vMac
//
// Created by Jesús A. Álvarez on 2024-02-10.
// Copyright © 2024 namedfork. All rights reserved.
//
import SwiftUI
struct PowerMenu: View {
var body: some View {
Menu() {
Section("Power") {
Button("Restart", systemImage: "arrowtriangle.right", role: .destructive) {
AppDelegate.shared.loadAndStartEmulator()
}
Button("Interrupt", systemImage: "arrowtriangle.down.circle", role: .destructive) {
AppDelegate.emulator.interrupt()
}
Button("Shut Down", systemImage: "minus.circle", role: .destructive) {
exit(0)
}
}
} label: {
Image(systemName: "power")
}.menuOrder(.fixed)
}
}
#Preview {
PowerMenu()
}