Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

fix(ui): remove light squares at update window corners (#1209)

Sergei Erokhin023a59c9f89b
diff --git a/Sources/Fluid/Services/SimpleUpdater.swift b/Sources/Fluid/Services/SimpleUpdater.swift
index 3de2272b..04635d91 100644
--- a/Sources/Fluid/Services/SimpleUpdater.swift
+++ b/Sources/Fluid/Services/SimpleUpdater.swift
@@ -752,9 +752,7 @@ final class SimpleUpdater: ObservableObject {
content.material = .popover
content.blendingMode = .behindWindow
content.state = .active
- content.wantsLayer = true
- content.layer?.cornerRadius = 16
- content.layer?.masksToBounds = true
+ content.maskImage = .roundedRectMask(cornerRadius: 16)
content.autoresizingMask = [.width, .height]
let icon = NSImageView(frame: NSRect(x: 22, y: 42, width: 52, height: 52))
diff --git a/Sources/Fluid/UI/UpdatePromptPresenter.swift b/Sources/Fluid/UI/UpdatePromptPresenter.swift
index d8c99ba4..0da3d069 100644
--- a/Sources/Fluid/UI/UpdatePromptPresenter.swift
+++ b/Sources/Fluid/UI/UpdatePromptPresenter.swift
@@ -125,9 +125,7 @@ final class UpdatePromptPresenter {
content.material = .popover
content.blendingMode = .behindWindow
content.state = .active
- content.wantsLayer = true
- content.layer?.cornerRadius = 16
- content.layer?.masksToBounds = true
+ content.maskImage = .roundedRectMask(cornerRadius: 16)
content.autoresizingMask = [.width, .height]
let icon = NSImageView(frame: NSRect(x: margin, y: panelHeight - margin - 52, width: 52, height: 52))
@@ -240,3 +238,20 @@ private final class FloatingPromptButton: NSButton {
onClick()
}
}
+
+extension NSImage {
+ static func roundedRectMask(cornerRadius: CGFloat) -> NSImage {
+ let stretchableCenter: CGFloat = 1
+ let maskSize = NSSize(
+ width: cornerRadius + stretchableCenter + cornerRadius,
+ height: cornerRadius + stretchableCenter + cornerRadius
+ )
+ let image = NSImage(size: maskSize, flipped: false) { rect in
+ NSColor.black.setFill()
+ NSBezierPath(roundedRect: rect, xRadius: cornerRadius, yRadius: cornerRadius).fill()
+ return true
+ }
+ image.capInsets = NSEdgeInsets(top: cornerRadius, left: cornerRadius, bottom: cornerRadius, right: cornerRadius)
+ return image
+ }
+}