macos: add rounded corners to the URL hover view

Also pad the view's position from the corners of the surface.
This commit is contained in:
Jon Parise
2024-11-15 09:27:42 -05:00
parent 4853597cd9
commit d9c9f44d6e

View File

@ -181,12 +181,16 @@ extension Ghostty {
Text(verbatim: url) Text(verbatim: url)
.padding(.init(top: padding, leading: padding, bottom: padding, trailing: padding)) .padding(.init(top: padding, leading: padding, bottom: padding, trailing: padding))
.background(.background) .background(
RoundedRectangle(cornerRadius: 5)
.fill(.background)
)
.lineLimit(1) .lineLimit(1)
.truncationMode(.middle) .truncationMode(.middle)
.opacity(isHoveringURLLeft ? 1 : 0) .opacity(isHoveringURLLeft ? 1 : 0)
} }
} }
.padding([.trailing, .bottom], padding)
HStack { HStack {
VStack(alignment: .leading) { VStack(alignment: .leading) {
@ -194,7 +198,10 @@ extension Ghostty {
Text(verbatim: url) Text(verbatim: url)
.padding(.init(top: padding, leading: padding, bottom: padding, trailing: padding)) .padding(.init(top: padding, leading: padding, bottom: padding, trailing: padding))
.background(.background) .background(
RoundedRectangle(cornerRadius: 5)
.fill(.background)
)
.lineLimit(1) .lineLimit(1)
.truncationMode(.middle) .truncationMode(.middle)
.opacity(isHoveringURLLeft ? 0 : 1) .opacity(isHoveringURLLeft ? 0 : 1)
@ -204,6 +211,7 @@ extension Ghostty {
} }
Spacer() Spacer()
} }
.padding([.leading, .bottom], padding)
} }
} }