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:
@ -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
|
||||
}
|
||||
}
|
38
phpmon/Assets.xcassets/StatusColorRed.colorset/Contents.json
Normal file
38
phpmon/Assets.xcassets/StatusColorRed.colorset/Contents.json
Normal 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
|
||||
}
|
||||
}
|
@ -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
|
||||
}
|
||||
}
|
@ -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")
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user