mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-23 15:41:41 +00:00
macos: move terminalViewContainer under BaseTerminalController
This commit is contained in:
@@ -159,7 +159,7 @@ class QuickTerminalController: BaseTerminalController {
|
||||
// applies if we can be seen.
|
||||
guard visible else { return }
|
||||
|
||||
window?.terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: true)
|
||||
terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: true)
|
||||
|
||||
// Re-hide the dock if we were hiding it before.
|
||||
hiddenDock?.hide()
|
||||
@@ -174,7 +174,7 @@ class QuickTerminalController: BaseTerminalController {
|
||||
// ensures we don't run logic twice.
|
||||
guard visible else { return }
|
||||
|
||||
window?.terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: false)
|
||||
terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: false)
|
||||
|
||||
// We don't animate out if there is a modal sheet being shown currently.
|
||||
// This lets us show alerts without causing the window to disappear.
|
||||
@@ -709,7 +709,7 @@ class QuickTerminalController: BaseTerminalController {
|
||||
|
||||
syncAppearance()
|
||||
|
||||
window?.terminalViewContainer?.ghosttyConfigDidChange(config, preferredBackgroundColor: nil)
|
||||
terminalViewContainer?.ghosttyConfigDidChange(config, preferredBackgroundColor: nil)
|
||||
}
|
||||
|
||||
@objc private func onNewTab(notification: SwiftUI.Notification) {
|
||||
|
||||
@@ -585,7 +585,7 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr
|
||||
|
||||
// Call this last in case it uses any of the properties above.
|
||||
window.syncAppearance(surfaceConfig)
|
||||
window.terminalViewContainer?.ghosttyConfigDidChange(ghostty.config, preferredBackgroundColor: window.preferredBackgroundColor)
|
||||
terminalViewContainer?.ghosttyConfigDidChange(ghostty.config, preferredBackgroundColor: window.preferredBackgroundColor)
|
||||
}
|
||||
|
||||
/// Adjusts the given frame for the configured window position.
|
||||
@@ -1147,12 +1147,12 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr
|
||||
super.windowDidBecomeKey(notification)
|
||||
self.relabelTabs()
|
||||
self.fixTabBar()
|
||||
window?.terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: true)
|
||||
terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: true)
|
||||
}
|
||||
|
||||
override func windowDidResignKey(_ notification: Notification) {
|
||||
super.windowDidResignKey(notification)
|
||||
window?.terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: false)
|
||||
terminalViewContainer?.updateGlassTintOverlay(isKeyWindow: false)
|
||||
}
|
||||
|
||||
override func windowDidMove(_ notification: Notification) {
|
||||
|
||||
@@ -77,11 +77,11 @@ class TerminalViewContainer: NSView {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - NSWindow + terminalViewContainer
|
||||
// MARK: - BaseTerminalController + terminalViewContainer
|
||||
|
||||
extension NSWindow {
|
||||
extension BaseTerminalController {
|
||||
var terminalViewContainer: TerminalViewContainer? {
|
||||
contentView as? TerminalViewContainer
|
||||
window?.contentView as? TerminalViewContainer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user