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

👌 Improve macOS Ventura appearance (#176)

This commit is contained in:
2022-06-20 18:49:43 +02:00
parent 6801283597
commit f8f3fd5c9b
7 changed files with 54 additions and 8 deletions

View File

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

View File

@ -7,8 +7,13 @@
import Foundation
extension String {
var localized: String {
if #available(macOS 13, *) {
return NSLocalizedString(
self, tableName: nil, bundle: Bundle.main, value: "", comment: ""
).replacingOccurrences(of: "Preferences", with: "Settings")
}
return NSLocalizedString(self, tableName: nil, bundle: Bundle.main, value: "", comment: "")
}
@ -32,7 +37,7 @@ extension String {
return count
}
subscript (r: Range<String.Index>) -> String {
subscript(r: Range<String.Index>) -> String {
let start = r.lowerBound
let end = r.upperBound
return String(self[start ..< end])

View File

@ -18,13 +18,13 @@ extension StatusMenu {
NSMenuItem(title: "mi_php_config".localized,
action: #selector(MainMenu.openActiveConfigFolder), keyEquivalent: "c")
)
self.addItem(
NSMenuItem(title: "mi_phpinfo".localized, action: #selector(MainMenu.openPhpInfo), keyEquivalent: "i")
)
self.addItem(
NSMenuItem(title: "mi_phpmon_config".localized,
action: #selector(MainMenu.openPhpMonitorConfigurationFile), keyEquivalent: "y")
)
self.addItem(
NSMenuItem(title: "mi_phpinfo".localized, action: #selector(MainMenu.openPhpInfo), keyEquivalent: "i")
)
}
func addComposerMenuItems() {

View File

@ -15,6 +15,9 @@ var isRunningSwiftUIPreview: Bool {
}
extension Color {
public static var appPrimary: Color = Color("AppColor")
public static var appSecondary: Color = Color("AppSecondary")
public static var debug: Color = {
if ProcessInfo.processInfo.environment["PAINT_PHPMON_SWIFTUI_VIEWS"] != nil {
return Color.yellow

View File

@ -15,7 +15,7 @@ struct HeaderView: View {
Text(text.uppercased())
.font(.system(size: 12))
.fontWeight(.bold)
.foregroundColor(.secondary)
.foregroundColor(.appSecondary)
.multilineTextAlignment(.leading)
.padding(.leading, 14.0)
.frame(maxWidth: .infinity, alignment: .leading)

View File

@ -16,7 +16,7 @@ struct SectionHeaderView: View {
Text(text)
.font(.system(size: 11))
.fontWeight(.medium)
.foregroundColor(.secondary)
.foregroundColor(.appSecondary)
.background(Color.debug)
}
}

View File

@ -106,7 +106,7 @@ struct CheckmarkView: View {
Image(systemName: "hourglass.circle")
.resizable()
.frame(width: 16.0, height: 16.0)
.foregroundColor(.secondary)
.foregroundColor(.appSecondary)
} else {
if busy {
ProgressView()