Match Ghostty mouse tracking and focus handling
This commit is contained in:
parent
846201b3c8
commit
de577c7f03
2 changed files with 210 additions and 16 deletions
|
|
@ -3,6 +3,7 @@ import SwiftUI
|
|||
struct ContentView: View {
|
||||
@EnvironmentObject var tabManager: TabManager
|
||||
@State private var sidebarWidth: CGFloat = 200
|
||||
@FocusState private var focusedTabId: UUID?
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 0) {
|
||||
|
|
@ -22,11 +23,19 @@ struct ContentView: View {
|
|||
GhosttyTerminalView(terminalSurface: tab.terminalSurface, isActive: isActive)
|
||||
.opacity(isActive ? 1 : 0)
|
||||
.allowsHitTesting(isActive)
|
||||
.focusable()
|
||||
.focused($focusedTabId, equals: tab.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(minWidth: 800, minHeight: 600)
|
||||
.background(Color(nsColor: .windowBackgroundColor))
|
||||
.onAppear {
|
||||
focusedTabId = tabManager.selectedTabId
|
||||
}
|
||||
.onChange(of: tabManager.selectedTabId) { newValue in
|
||||
focusedTabId = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue