mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 23:24:32 +00:00
BugFix: Corners in borders for panels
This commit is contained in:
parent
18f68f56ea
commit
3eb9122b9f
4 changed files with 45 additions and 0 deletions
|
|
@ -9,6 +9,16 @@ import SwiftUI
|
|||
import Cocoa
|
||||
import Defaults
|
||||
|
||||
private func applyColorPickerCornerMask(_ view: NSView, radius: CGFloat) {
|
||||
view.wantsLayer = true
|
||||
view.layer?.masksToBounds = true
|
||||
view.layer?.cornerRadius = radius
|
||||
view.layer?.backgroundColor = NSColor.clear.cgColor
|
||||
if #available(macOS 13.0, *) {
|
||||
view.layer?.cornerCurve = .continuous
|
||||
}
|
||||
}
|
||||
|
||||
class ColorPickerPanelManager: ObservableObject {
|
||||
static let shared = ColorPickerPanelManager()
|
||||
|
||||
|
|
@ -103,6 +113,7 @@ class ColorPickerPanel: NSPanel {
|
|||
}
|
||||
|
||||
let hostingView = NSHostingView(rootView: panelView)
|
||||
applyColorPickerCornerMask(hostingView, radius: 12)
|
||||
contentView = hostingView
|
||||
|
||||
// Set initial size
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue