From d9c9f44d6e83f4b90be1b97aa1693f25e20c1f7b Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Fri, 15 Nov 2024 09:27:42 -0500 Subject: [PATCH] macos: add rounded corners to the URL hover view Also pad the view's position from the corners of the surface. --- macos/Sources/Ghostty/SurfaceView.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index 25fa99a2e..5bc4417c5 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -181,12 +181,16 @@ extension Ghostty { Text(verbatim: url) .padding(.init(top: padding, leading: padding, bottom: padding, trailing: padding)) - .background(.background) + .background( + RoundedRectangle(cornerRadius: 5) + .fill(.background) + ) .lineLimit(1) .truncationMode(.middle) .opacity(isHoveringURLLeft ? 1 : 0) } } + .padding([.trailing, .bottom], padding) HStack { VStack(alignment: .leading) { @@ -194,7 +198,10 @@ extension Ghostty { Text(verbatim: url) .padding(.init(top: padding, leading: padding, bottom: padding, trailing: padding)) - .background(.background) + .background( + RoundedRectangle(cornerRadius: 5) + .fill(.background) + ) .lineLimit(1) .truncationMode(.middle) .opacity(isHoveringURLLeft ? 0 : 1) @@ -204,6 +211,7 @@ extension Ghostty { } Spacer() } + .padding([.leading, .bottom], padding) } }