mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 09:16:11 +03:00
macos: little tweaks
This commit is contained in:
@ -46,6 +46,7 @@ extension Ghostty {
|
||||
GeometryReader { geo in
|
||||
Surface(view: surfaceView, hasFocus: hasFocus, size: geo.size)
|
||||
.focused($surfaceFocus)
|
||||
.focusedValue(\.ghosttySurfaceView, surfaceView)
|
||||
.navigationTitle(surfaceView.title)
|
||||
}
|
||||
.ghosttySurfaceView(surfaceView)
|
||||
@ -511,3 +512,17 @@ extension View {
|
||||
environment(\.ghosttySurfaceView, surfaceView)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Surface Focus Keys
|
||||
|
||||
extension FocusedValues {
|
||||
var ghosttySurfaceView: Ghostty.SurfaceView? {
|
||||
get { self[FocusedGhosttySurface.self] }
|
||||
set { self[FocusedGhosttySurface.self] = newValue }
|
||||
}
|
||||
|
||||
struct FocusedGhosttySurface: FocusedValueKey {
|
||||
typealias Value = Ghostty.SurfaceView
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ struct GhosttyApp: App {
|
||||
|
||||
/// The ghostty global state. Only one per process.
|
||||
@StateObject private var ghostty = Ghostty.AppState()
|
||||
@NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate;
|
||||
@NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
|
Reference in New Issue
Block a user