mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +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
|
|
@ -8,6 +8,16 @@ import AppKit
|
|||
import SwiftUI
|
||||
import Defaults
|
||||
|
||||
private func applyModelSelectionCornerMask(_ 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
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Model Selection Panel
|
||||
class ModelSelectionPanel: NSPanel {
|
||||
|
||||
|
|
@ -66,6 +76,7 @@ class ModelSelectionPanel: NSPanel {
|
|||
private func setupContentView() {
|
||||
let contentView = ModelSelectionView()
|
||||
let hostingView = NSHostingView(rootView: contentView)
|
||||
applyModelSelectionCornerMask(hostingView, radius: 16)
|
||||
self.contentView = hostingView
|
||||
|
||||
// Set size for model selection panel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue