Skip to content

Commit f86dd7e

Browse files
committed
Note Issue With Glass Here
1 parent 23fd2e6 commit f86dd7e

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

CodeEdit/Features/Editor/Views/EditorAreaView.swift

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@ struct EditorAreaView: View {
1818

1919
@AppSettings(\.general.dimEditorsWithoutFocus)
2020
var dimEditorsWithoutFocus
21-
22-
@AppSettings(\.theme.useThemeBackground)
23-
var useThemeBackground
24-
25-
private var backgroundColor: NSColor {
26-
let fallback = NSColor.textBackgroundColor
27-
return if useThemeBackground {
28-
ThemeModel.shared.selectedTheme?.editor.background.nsColor ?? fallback
29-
} else {
30-
fallback
31-
}
32-
}
3321

3422
@ObservedObject var editor: Editor
3523

@@ -152,6 +140,34 @@ struct EditorAreaView: View {
152140
.if(.tahoe) {
153141
// FB20047271: Glass toolbar effect ignores floating scroll view views.
154142
// https://openradar.appspot.com/radar?id=EhAKBVJhZGFyEICAgKbGmesJ
143+
144+
// FB20191516: Can't disable backgrounded liquid glass tint
145+
// https://openradar.appspot.com/radar?id=EhAKBVJhZGFyEICAgLqTk-4J
146+
// Tracking Issue: #2191
147+
// Add this to the top:
148+
// ```
149+
// @AppSettings(\.theme.useThemeBackground)
150+
// var useThemeBackground
151+
//
152+
// private var backgroundColor: NSColor {
153+
// let fallback = NSColor.textBackgroundColor
154+
// return if useThemeBackground {
155+
// ThemeModel.shared.selectedTheme?.editor.background.nsColor ?? fallback
156+
// } else {
157+
// fallback
158+
// }
159+
// }
160+
// ```
161+
// And use this:
162+
// ```
163+
// $0.background(
164+
// Rectangle().fill(.clear)
165+
// .glassEffect(.regular.tint(Color(backgroundColor))
166+
// .ignoresSafeArea(.all)
167+
// )
168+
// ```
169+
// When we can figure out how to disable the 'not focused' glass effect.
170+
155171
$0.background(EffectView(.headerView).ignoresSafeArea(.all))
156172
} else: {
157173
$0.background(EffectView(.headerView))

0 commit comments

Comments
 (0)