mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-11-22 03:30:59 +00:00
34 lines
876 B
Swift
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()
|
|
}
|