Skip to content

Commit e93c648

Browse files
Fixed incorrect background colors to be more consistent. (CodeEditApp#936)
1 parent 60bc4f0 commit e93c648

File tree

3 files changed

+14
-26
lines changed

3 files changed

+14
-26
lines changed

CodeEdit/Features/TabBar/Views/TabBarDivider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct TabBarBottomDivider: View {
6666
.foregroundColor(
6767
prefs.preferences.general.tabBarStyle == .xcode
6868
? Color(nsColor: .separatorColor)
69-
.opacity(colorScheme == .dark ? 0.80 : 0.40)
69+
.opacity(colorScheme == .dark ? 0.80 : 1)
7070
: Color(nsColor: .black)
7171
.opacity(colorScheme == .dark ? 0.65 : 0.13)
7272

CodeEdit/Features/TabBar/Views/TabBarView.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,15 +392,7 @@ struct TabBarView: View {
392392
}
393393
}
394394
.background {
395-
if prefs.preferences.general.tabBarStyle == .xcode {
396-
EffectView(
397-
NSVisualEffectView.Material.titlebar,
398-
blendingMode: NSVisualEffectView.BlendingMode.withinWindow
399-
)
400-
// Set bottom padding to avoid material overlapping in bar.
401-
.padding(.bottom, TabBarView.height)
402-
.edgesIgnoringSafeArea(.top)
403-
} else {
395+
if prefs.preferences.general.tabBarStyle == .native {
404396
TabBarNativeMaterial()
405397
.edgesIgnoringSafeArea(.top)
406398
}

CodeEdit/WorkspaceView.swift

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ struct WorkspaceView: View {
4949
@State
5050
private var leaveFullscreenObserver: Any?
5151

52+
@Environment(\.colorScheme) var colorScheme
53+
5254
var noEditor: some View {
5355
Text("No Editor")
5456
.font(.system(size: 17))
@@ -80,27 +82,21 @@ struct WorkspaceView: View {
8082
ZStack {
8183
tabContent
8284
}
83-
.frame(maxWidth: .infinity, maxHeight: .infinity)
84-
.background {
85-
if prefs.preferences.general.tabBarStyle == .xcode {
86-
// Use the same background material as xcode tab bar style.
87-
// Only when the tab bar style is set to `xcode`.
88-
TabBarXcodeBackground()
89-
}
90-
}
91-
.safeAreaInset(edge: .top, spacing: 0) {
92-
VStack(spacing: 0) {
93-
TabBarView(windowController: windowController, workspace: workspace)
94-
TabBarBottomDivider()
95-
}
96-
}
97-
.safeAreaInset(edge: .bottom) {
98-
StatusBarView(model: model)
85+
.frame(maxWidth: .infinity, maxHeight: .infinity)
86+
.safeAreaInset(edge: .top, spacing: 0) {
87+
VStack(spacing: 0) {
88+
TabBarView(windowController: windowController, workspace: workspace)
89+
TabBarBottomDivider()
9990
}
91+
}
92+
.safeAreaInset(edge: .bottom) {
93+
StatusBarView(model: model)
94+
}
10095
} else {
10196
EmptyView()
10297
}
10398
}
99+
.background(colorScheme == .dark ? Color(.black).opacity(0.25) : Color(.white))
104100
.alert(alertTitle, isPresented: $showingAlert, actions: {
105101
Button(
106102
action: { showingAlert = false },

0 commit comments

Comments
 (0)