Skip to content

Commit 76a0206

Browse files
committed
Theme the window
1 parent af0059e commit 76a0206

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Sources/CodeEditSourceEditor/CodeSuggestion/SuggestionViewController.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,26 @@ class SuggestionViewController: NSViewController {
7171
super.viewWillAppear()
7272
resetScrollPosition()
7373
tableView.reloadData()
74+
if let controller = model?.activeTextView {
75+
styleView(using: controller)
76+
}
7477
}
7578

7679
func styleView(using controller: TextViewController) {
7780
switch controller.systemAppearance {
7881
case .aqua:
79-
tintView.layer?.backgroundColor = controller.theme.background.withAlphaComponent(0.3).cgColor
82+
let color = controller.theme.background
83+
if color != .clear {
84+
let newColor = NSColor(
85+
red: color.redComponent * 0.95,
86+
green: color.greenComponent * 0.95,
87+
blue: color.blueComponent * 0.95,
88+
alpha: 1.0
89+
)
90+
tintView.layer?.backgroundColor = newColor.cgColor
91+
} else {
92+
tintView.layer?.backgroundColor = .clear
93+
}
8094
case .darkAqua:
8195
tintView.layer?.backgroundColor = controller.theme.background.cgColor
8296
default:

0 commit comments

Comments
 (0)