1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02:00

👌 Use specific theme colors for services status

This commit is contained in:
2023-01-17 18:05:22 +01:00
parent a46602d4b4
commit e8d705e228
5 changed files with 120 additions and 6 deletions

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.501",
"green" : "0.697",
"red" : "0.247"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.501",
"green" : "0.765",
"red" : "0.247"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.180",
"green" : "0.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.426",
"green" : "0.363",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.180",
"green" : "0.841",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.426",
"green" : "0.809",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -66,7 +66,7 @@ class ServicesManager: ObservableObject {
public var statusColor: Color {
if self.services.isEmpty || !self.firstRunComplete {
return .yellow
return Color("StatusColorYellow")
}
let statuses = self.services[0...2].map { $0.status }
@ -74,10 +74,10 @@ class ServicesManager: ObservableObject {
if statuses.contains(.missing)
|| statuses.contains(.inactive)
|| statuses.contains(.error) {
return .red
return Color("StatusColorRed")
}
return .green
return Color("StatusColorGreen")
}
/**

View File

@ -143,7 +143,7 @@ struct ServiceView: View {
} label: {
Text("E")
.frame(width: 12.0, height: 12.0)
.foregroundColor(Color("IconColorRed"))
.foregroundColor(Color("StatusColorRed"))
}
.focusable(false)
.frame(width: 25, height: 25)
@ -163,8 +163,8 @@ struct ServiceView: View {
.frame(width: 12.0, height: 12.0)
.foregroundColor(
service.status == .active
? Color("IconColorGreen")
: Color("IconColorRed")
? Color("StatusColorGreen")
: Color("StatusColorRed")
)
}
.focusable(false)