Skip to content

Commit

Permalink
Add ProgressView into ServicesNotRunningAlertView
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Aug 8, 2024
1 parent d25bd4c commit 188c142
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions src/apps/SettingsWindow/src/View/ServicesNotRunningAlertView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ struct ServicesNotRunningAlertView: View {
}
}

if servicesMonitor.servicesEnabled {
ProgressView()
}

VStack(alignment: .leading, spacing: 0.0) {
Label(
"Karabiner-Elements Non-Privileged Agents",
Expand All @@ -46,17 +50,19 @@ struct ServicesNotRunningAlertView: View {
servicesMonitor.coreDaemonsRunning ? "checkmark.circle.fill" : "circle")
}

Button(
action: {
SMAppService.openSystemSettingsLoginItems()
},
label: {
Label(
"Open System Settings > General > Login Items",
systemImage: "arrow.forward.circle.fill")
}
)
.focused($focus)
if !servicesMonitor.servicesEnabled || servicesMonitor.servicesWaitingSeconds > 15 {
Button(
action: {
SMAppService.openSystemSettingsLoginItems()
},
label: {
Label(
"Open System Settings > General > Login Items",
systemImage: "arrow.forward.circle.fill")
}
)
.focused($focus)
}

Label(
"If these are already enabled, the settings might not be properly reflected on the macOS side. Please disable them once and then enable them again.",
Expand All @@ -66,10 +72,12 @@ struct ServicesNotRunningAlertView: View {
.foregroundColor(Color.warningForeground)
.background(Color.warningBackground)

Image(decorative: "login-items")
.resizable()
.aspectRatio(contentMode: .fit)
.border(Color.gray, width: 1)
if !servicesMonitor.servicesEnabled {
Image(decorative: "login-items")
.resizable()
.aspectRatio(contentMode: .fit)
.border(Color.gray, width: 1)
}

}
.padding()
Expand Down

0 comments on commit 188c142

Please sign in to comment.