Skip to content

Commit

Permalink
Merge pull request #5441 from jnsdrtlf/feature/play-button
Browse files Browse the repository at this point in the history
Update "Run" icons across the main interface
  • Loading branch information
osy committed Jul 17, 2023
2 parents e15b878 + a2966eb commit dbf5569
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions Platform/Shared/VMCardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ struct VMCardView: View {
@EnvironmentObject private var data: UTMData

#if os(macOS)
let buttonColor: Color = .black
typealias PlatformImage = NSImage
#else
let buttonColor: Color = .accentColor
typealias PlatformImage = UIImage
#endif

Expand All @@ -51,9 +49,8 @@ struct VMCardView: View {
Button {
data.run(vm: vm)
} label: {
Label("Run", systemImage: "play.circle")
Label("Run", systemImage: "play.circle.fill")
.font(.largeTitle)
.foregroundColor(buttonColor)
.labelStyle(.iconOnly)
}
} else if vm.isBusy {
Expand Down
8 changes: 4 additions & 4 deletions Platform/Shared/VMContextMenuModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ struct VMContextMenuModifier: ViewModifier {
Button {
confirmAction = .confirmStopVM
} label: {
Label("Stop", systemImage: "stop.fill")
Label("Stop", systemImage: "stop")
}.help("Stop the running VM.")
} else if !vm.isModifyAllowed { // paused
Button {
data.run(vm: vm)
} label: {
Label("Resume", systemImage: "playpause.fill")
Label("Resume", systemImage: "playpause")
}.help("Resume running VM.")
} else {
Divider()

Button {
data.run(vm: vm)
} label: {
Label("Run", systemImage: "play.fill")
Label("Run", systemImage: "play")
}.help("Run the VM in the foreground.")

#if os(macOS) && arch(arm64)
Expand All @@ -75,7 +75,7 @@ struct VMContextMenuModifier: ViewModifier {
Button {
data.run(vm: vm, options: .bootDisposibleMode)
} label: {
Label("Run without saving changes", systemImage: "play")
Label("Run without saving changes", systemImage: "memories")
}.help("Run the VM in the foreground, without saving data changes to disk.")
}

Expand Down
4 changes: 2 additions & 2 deletions Platform/Shared/VMToolbarModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ struct VMToolbarModifier: ViewModifier {
Button {
confirmAction = .confirmStopVM
} label: {
Label("Stop", systemImage: "stop.fill")
Label("Stop", systemImage: "stop")
.labelStyle(.iconOnly)
}.help("Stop selected VM")
.padding(.leading, padding)
} else {
Button {
data.run(vm: data.selectedVM!)
} label: {
Label("Run", systemImage: "play.fill")
Label("Run", systemImage: "play")
.labelStyle(.iconOnly)
}.help("Run selected VM")
.padding(.leading, padding)
Expand Down

0 comments on commit dbf5569

Please sign in to comment.