From 96f661940c859cb2be57bba25ff088c8f951a5a0 Mon Sep 17 00:00:00 2001 From: Jonas Drotleff Date: Sat, 8 Jul 2023 17:10:19 +0300 Subject: [PATCH 1/2] home: Change color of "Run" button The color now adapts to the current selection state and the system appearance. See issue #4759 (https://github.com/utmapp/UTM/issues/4759) --- Platform/Shared/VMCardView.swift | 3 --- 1 file changed, 3 deletions(-) diff --git a/Platform/Shared/VMCardView.swift b/Platform/Shared/VMCardView.swift index 14c301ae6..63be9fb95 100644 --- a/Platform/Shared/VMCardView.swift +++ b/Platform/Shared/VMCardView.swift @@ -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 @@ -53,7 +51,6 @@ struct VMCardView: View { } label: { Label("Run", systemImage: "play.circle") .font(.largeTitle) - .foregroundColor(buttonColor) .labelStyle(.iconOnly) } } else if vm.isBusy { From ec778d07ca38dc2d7fe5f1c6ee331b2b140e4c32 Mon Sep 17 00:00:00 2001 From: Jonas Drotleff Date: Sat, 8 Jul 2023 17:10:58 +0300 Subject: [PATCH 2/2] home: Use more consistent 'play' icons in menus --- Platform/Shared/VMCardView.swift | 2 +- Platform/Shared/VMContextMenuModifier.swift | 10 +++++----- Platform/Shared/VMToolbarModifier.swift | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Platform/Shared/VMCardView.swift b/Platform/Shared/VMCardView.swift index 63be9fb95..f140a9bfa 100644 --- a/Platform/Shared/VMCardView.swift +++ b/Platform/Shared/VMCardView.swift @@ -49,7 +49,7 @@ struct VMCardView: View { Button { data.run(vm: vm) } label: { - Label("Run", systemImage: "play.circle") + Label("Run", systemImage: "play.circle.fill") .font(.largeTitle) .labelStyle(.iconOnly) } diff --git a/Platform/Shared/VMContextMenuModifier.swift b/Platform/Shared/VMContextMenuModifier.swift index cae0dd6e1..97b5c33b7 100644 --- a/Platform/Shared/VMContextMenuModifier.swift +++ b/Platform/Shared/VMContextMenuModifier.swift @@ -44,13 +44,13 @@ 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() @@ -58,7 +58,7 @@ struct VMContextMenuModifier: ViewModifier { 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) @@ -66,7 +66,7 @@ struct VMContextMenuModifier: ViewModifier { Button { data.run(vm: vm, options: .bootRecovery) } label: { - Label("Run Recovery", systemImage: "play.fill") + Label("Run Recovery", systemImage: "play") }.help("Boot into recovery mode.") } #endif @@ -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.") } diff --git a/Platform/Shared/VMToolbarModifier.swift b/Platform/Shared/VMToolbarModifier.swift index 2424af777..9fab19c34 100644 --- a/Platform/Shared/VMToolbarModifier.swift +++ b/Platform/Shared/VMToolbarModifier.swift @@ -113,7 +113,7 @@ 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) @@ -121,7 +121,7 @@ struct VMToolbarModifier: ViewModifier { 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)