mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Fix new deprecation warnings introduced by bumping deployment target
This commit is contained in:
@ -91,27 +91,27 @@ struct TerminalView<ViewModel: TerminalViewModel>: View {
|
||||
.environment(ghostty)
|
||||
.focused($focused)
|
||||
.onAppear { self.focused = true }
|
||||
.onChange(of: focusedSurface) { newValue in
|
||||
self.delegate?.focusedSurfaceDidChange(to: newValue)
|
||||
.onChange(of: focusedSurface) {
|
||||
self.delegate?.focusedSurfaceDidChange(to: focusedSurface)
|
||||
}
|
||||
.onChange(of: title) { newValue in
|
||||
self.delegate?.titleDidChange(to: newValue)
|
||||
.onChange(of: title) {
|
||||
self.delegate?.titleDidChange(to: title)
|
||||
}
|
||||
.onChange(of: pwdURL) { newValue in
|
||||
self.delegate?.pwdDidChange(to: newValue)
|
||||
.onChange(of: pwdURL) {
|
||||
self.delegate?.pwdDidChange(to: pwdURL)
|
||||
}
|
||||
.onChange(of: cellSize) { newValue in
|
||||
guard let size = newValue else { return }
|
||||
.onChange(of: cellSize) {
|
||||
guard let size = cellSize else { return }
|
||||
self.delegate?.cellSizeDidChange(to: size)
|
||||
}
|
||||
.onChange(of: viewModel.surfaceTree?.hashValue) { _ in
|
||||
.onChange(of: viewModel.surfaceTree?.hashValue) {
|
||||
// This is funky, but its the best way I could think of to detect
|
||||
// ANY CHANGE within the deeply nested surface tree -- detecting a change
|
||||
// in the hash value.
|
||||
self.delegate?.surfaceTreeDidChange()
|
||||
}
|
||||
.onChange(of: zoomedSplit) { newValue in
|
||||
self.delegate?.zoomStateDidChange(to: newValue ?? false)
|
||||
.onChange(of: zoomedSplit) {
|
||||
self.delegate?.zoomStateDidChange(to: zoomedSplit ?? false)
|
||||
}
|
||||
}
|
||||
// Ignore safe area to extend up in to the titlebar region if we have the "hidden" titlebar style
|
||||
|
@ -37,10 +37,10 @@ extension Ghostty {
|
||||
}
|
||||
}
|
||||
.onReceive(pubInspector) { onControlInspector($0) }
|
||||
.onChange(of: surfaceView.inspectorVisible) { inspectorVisible in
|
||||
.onChange(of: surfaceView.inspectorVisible) {
|
||||
// When we show the inspector, we want to focus on the inspector.
|
||||
// When we hide the inspector, we want to move focus back to the surface.
|
||||
if (inspectorVisible) {
|
||||
if (surfaceView.inspectorVisible) {
|
||||
// We need to delay this until SwiftUI shows the inspector.
|
||||
DispatchQueue.main.async {
|
||||
_ = surfaceView.resignFirstResponder()
|
||||
|
Reference in New Issue
Block a user