Replace some deprecated methods with newer ones

This commit is contained in:
Damiano Galassi committed 2024-07-06 17:03:58 +02:00
1 parent 89ba80859e
commit ea9a72b28a
5 files changed
+9 -8

No files matched your search

+3 -3
View File
@@ -9,7 +9,7 @@ import Cocoa
final class TokenFieldCell : NSTokenFieldCell {
private var originalBackgroundStyle: NSView.BackgroundStyle = NSView.BackgroundStyle.light
private var originalBackgroundStyle: NSView.BackgroundStyle = NSView.BackgroundStyle.normal
override var backgroundStyle: NSView.BackgroundStyle {
get {
@@ -17,7 +17,7 @@ final class TokenFieldCell : NSTokenFieldCell {
}
set (newBackgroundStyle) {
super.backgroundStyle = newBackgroundStyle
if newBackgroundStyle == NSView.BackgroundStyle.dark {
if newBackgroundStyle == NSView.BackgroundStyle.emphasized {
textColor = NSColor.controlHighlightColor
} else {
textColor = NSColor.controlTextColor
@@ -27,7 +27,7 @@ final class TokenFieldCell : NSTokenFieldCell {
override func setUpFieldEditorAttributes(_ textObj: NSText) -> NSText {
originalBackgroundStyle = backgroundStyle
backgroundStyle = NSView.BackgroundStyle.light
backgroundStyle = NSView.BackgroundStyle.normal
drawsBackground = true
return super.setUpFieldEditorAttributes(textObj)
}