mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Converted config declaration to an enum
This commit is contained in:
@ -229,14 +229,15 @@ extension Ghostty {
|
||||
return String(cString: ptr)
|
||||
}
|
||||
|
||||
var macosTitlebarProxyIcon: String {
|
||||
let defaultValue = "visible"
|
||||
var macosTitlebarProxyIcon: Ghostty.MacOSTitlebarProxyIcon {
|
||||
let defaultValue = Ghostty.MacOSTitlebarProxyIcon.visible
|
||||
guard let config = self.config else { return defaultValue }
|
||||
var v: UnsafePointer<Int8>? = nil
|
||||
let key = "macos-titlebar-proxy-icon"
|
||||
guard ghostty_config_get(config, &v, key, UInt(key.count)) else { return defaultValue }
|
||||
guard let ptr = v else { return defaultValue }
|
||||
return String(cString: ptr)
|
||||
let str = String(cString: ptr)
|
||||
return Ghostty.MacOSTitlebarProxyIcon(rawValue: str) ?? defaultValue
|
||||
}
|
||||
|
||||
var macosWindowShadow: Bool {
|
||||
|
@ -194,6 +194,13 @@ extension Ghostty {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Enum for the macos-titlebar-proxy-icon config option
|
||||
enum MacOSTitlebarProxyIcon: String {
|
||||
case visible
|
||||
case hidden
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: Surface Notifications
|
||||
|
Reference in New Issue
Block a user