mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-23 15:41:41 +00:00
macos: remove associated type from TerminalViewContainer
This commit is contained in:
@@ -137,11 +137,9 @@ class QuickTerminalController: BaseTerminalController {
|
||||
}
|
||||
|
||||
// Setup our content
|
||||
window.contentView = TerminalViewContainer(
|
||||
ghostty: self.ghostty,
|
||||
viewModel: self,
|
||||
delegate: self
|
||||
)
|
||||
window.contentView = TerminalViewContainer {
|
||||
TerminalView(ghostty: ghostty, viewModel: self, delegate: self)
|
||||
}
|
||||
|
||||
// Clear out our frame at this point, the fixup from above is complete.
|
||||
if let qtWindow = window as? QuickTerminalWindow {
|
||||
|
||||
@@ -1024,11 +1024,9 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr
|
||||
}
|
||||
|
||||
// Initialize our content view to the SwiftUI root
|
||||
window.contentView = TerminalViewContainer(
|
||||
ghostty: self.ghostty,
|
||||
viewModel: self,
|
||||
delegate: self,
|
||||
)
|
||||
window.contentView = TerminalViewContainer {
|
||||
TerminalView(ghostty: ghostty, viewModel: self, delegate: self)
|
||||
}
|
||||
|
||||
// If we have a default size, we want to apply it.
|
||||
if let defaultSize {
|
||||
|
||||
@@ -3,20 +3,15 @@ import SwiftUI
|
||||
|
||||
/// Use this container to achieve a glass effect at the window level.
|
||||
/// Modifying `NSThemeFrame` can sometimes be unpredictable.
|
||||
class TerminalViewContainer<ViewModel: TerminalViewModel>: NSView {
|
||||
class TerminalViewContainer: NSView {
|
||||
private let terminalView: NSView
|
||||
|
||||
/// Combined glass effect and inactive tint overlay view
|
||||
private var glassEffectView: NSView?
|
||||
private var derivedConfig: DerivedConfig?
|
||||
|
||||
init(ghostty: Ghostty.App, viewModel: ViewModel, delegate: (any TerminalViewDelegate)? = nil) {
|
||||
self.derivedConfig = DerivedConfig(config: ghostty.config, preferredBackgroundColor: nil, cornerRadius: nil)
|
||||
self.terminalView = NSHostingView(rootView: TerminalView(
|
||||
ghostty: ghostty,
|
||||
viewModel: viewModel,
|
||||
delegate: delegate
|
||||
))
|
||||
init<Root: View>(@ViewBuilder rootView: () -> Root) {
|
||||
self.terminalView = NSHostingView(rootView: rootView())
|
||||
super.init(frame: .zero)
|
||||
setup()
|
||||
}
|
||||
|
||||
@@ -106,7 +106,6 @@ extension NSWindow {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Internal Properties
|
||||
|
||||
extension NSWindow {
|
||||
|
||||
Reference in New Issue
Block a user