mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-13 13:26:09 +00:00
macos: clean up the permission request
This commit is contained in:
@@ -1008,7 +1008,7 @@ class AppDelegate: NSObject,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func checkForUpdates(_ sender: Any?) {
|
@IBAction func checkForUpdates(_ sender: Any?) {
|
||||||
UpdateSimulator.error.simulate(with: updateViewModel)
|
UpdateSimulator.permissionRequest.simulate(with: updateViewModel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ fileprivate struct PermissionRequestView: View {
|
|||||||
Text("Enable automatic updates?")
|
Text("Enable automatic updates?")
|
||||||
.font(.system(size: 13, weight: .semibold))
|
.font(.system(size: 13, weight: .semibold))
|
||||||
|
|
||||||
Text("Ghostty can automatically check for and download updates in the background.")
|
Text("Ghostty can automatically check for updates in the background.")
|
||||||
.font(.system(size: 11))
|
.font(.system(size: 11))
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
.fixedSize(horizontal: false, vertical: true)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
|
@@ -13,7 +13,7 @@ class UpdateViewModel: ObservableObject {
|
|||||||
case .idle:
|
case .idle:
|
||||||
return ""
|
return ""
|
||||||
case .permissionRequest:
|
case .permissionRequest:
|
||||||
return "Update Permission"
|
return "Enable Automatic Updates?"
|
||||||
case .checking:
|
case .checking:
|
||||||
return "Checking for Updates…"
|
return "Checking for Updates…"
|
||||||
case .updateAvailable(let update):
|
case .updateAvailable(let update):
|
||||||
@@ -67,7 +67,9 @@ class UpdateViewModel: ObservableObject {
|
|||||||
switch state {
|
switch state {
|
||||||
case .idle:
|
case .idle:
|
||||||
return .secondary
|
return .secondary
|
||||||
case .permissionRequest, .checking:
|
case .permissionRequest:
|
||||||
|
return .white
|
||||||
|
case .checking:
|
||||||
return .secondary
|
return .secondary
|
||||||
case .updateAvailable, .readyToInstall:
|
case .updateAvailable, .readyToInstall:
|
||||||
return .accentColor
|
return .accentColor
|
||||||
@@ -83,6 +85,8 @@ class UpdateViewModel: ObservableObject {
|
|||||||
/// The background color for the update pill.
|
/// The background color for the update pill.
|
||||||
var backgroundColor: Color {
|
var backgroundColor: Color {
|
||||||
switch state {
|
switch state {
|
||||||
|
case .permissionRequest:
|
||||||
|
return Color(nsColor: NSColor.systemBlue.blended(withFraction: 0.3, of: .black) ?? .systemBlue)
|
||||||
case .updateAvailable:
|
case .updateAvailable:
|
||||||
return .accentColor
|
return .accentColor
|
||||||
case .readyToInstall:
|
case .readyToInstall:
|
||||||
@@ -99,6 +103,8 @@ class UpdateViewModel: ObservableObject {
|
|||||||
/// The foreground (text) color for the update pill.
|
/// The foreground (text) color for the update pill.
|
||||||
var foregroundColor: Color {
|
var foregroundColor: Color {
|
||||||
switch state {
|
switch state {
|
||||||
|
case .permissionRequest:
|
||||||
|
return .white
|
||||||
case .updateAvailable, .readyToInstall:
|
case .updateAvailable, .readyToInstall:
|
||||||
return .white
|
return .white
|
||||||
case .notFound:
|
case .notFound:
|
||||||
|
Reference in New Issue
Block a user