mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-29 14:38:35 +00:00
macos: implement bell-features=border on macOS
This commit is contained in:
@@ -199,6 +199,11 @@ extension Ghostty {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Show bell border if enabled
|
||||||
|
if (ghostty.config.bellFeatures.contains(.border)) {
|
||||||
|
BellBorderOverlay(bell: surfaceView.bell)
|
||||||
|
}
|
||||||
|
|
||||||
// If our surface is not healthy, then we render an error view over it.
|
// If our surface is not healthy, then we render an error view over it.
|
||||||
if (!surfaceView.healthy) {
|
if (!surfaceView.healthy) {
|
||||||
Rectangle().fill(ghostty.config.backgroundColor)
|
Rectangle().fill(ghostty.config.backgroundColor)
|
||||||
@@ -526,6 +531,22 @@ extension Ghostty {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Visual overlay that shows a border around the edges when the bell rings with border feature enabled.
|
||||||
|
struct BellBorderOverlay: View {
|
||||||
|
let bell: Bool
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
Rectangle()
|
||||||
|
.strokeBorder(
|
||||||
|
Color(red: 1.0, green: 0.8, blue: 0.0).opacity(0.5),
|
||||||
|
lineWidth: 3
|
||||||
|
)
|
||||||
|
.allowsHitTesting(false)
|
||||||
|
.opacity(bell ? 1.0 : 0.0)
|
||||||
|
.animation(.easeInOut(duration: 0.3), value: bell)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if canImport(AppKit)
|
#if canImport(AppKit)
|
||||||
/// When changing the split state, or going full screen (native or non), the terminal view
|
/// When changing the split state, or going full screen (native or non), the terminal view
|
||||||
/// will lose focus. There has to be some nice SwiftUI-native way to fix this but I can't
|
/// will lose focus. There has to be some nice SwiftUI-native way to fix this but I can't
|
||||||
|
Reference in New Issue
Block a user