Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CodeEdit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3738,7 +3738,7 @@
repositoryURL = "https://github.com/CodeEditApp/CodeEditTextView.git";
requirement = {
kind = exactVersion;
version = 0.3.3;
version = 0.3.4;
};
};
58F2EB18292FB91C004A9BDE /* XCRemoteSwiftPackageReference "Preferences" */ = {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions CodeEdit/Features/CodeFile/CodeFileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,26 @@ struct CodeFileView: View {
tabWidth: $prefs.preferences.textEditing.defaultTabWidth,
lineHeight: $prefs.preferences.textEditing.lineHeightMultiple,
wrapLines: $prefs.preferences.textEditing.wrapLinesToEditorWidth,
cursorPosition: codeFile.$cursorPosition
cursorPosition: codeFile.$cursorPosition,
useThemeBackground: prefs.preferences.theme.useThemeBackground
)
.id(codeFile.fileURL)
.background(selectedTheme.editor.background.swiftColor)
.background {
if colorScheme == .dark {
if prefs.preferences.theme.selectedTheme == prefs.preferences.theme.selectedLightTheme {
Color.white
} else {
EffectView(.underPageBackground)
}
} else {
if prefs.preferences.theme.selectedTheme == prefs.preferences.theme.selectedDarkTheme {
Color.black
} else {
EffectView(.contentBackground)
}

}
}
.disabled(!editable)
.frame(maxHeight: .infinity)
.onChange(of: ThemeModel.shared.selectedTheme) { newValue in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ struct StatusBarDrawer: View {
@EnvironmentObject
private var model: StatusBarViewModel

@ObservedObject
private var prefs: AppPreferencesModel = .shared

@Environment(\.colorScheme)
private var colorScheme

@State
private var searchText = ""

Expand All @@ -27,7 +33,24 @@ struct StatusBarDrawer: View {
var body: some View {
VStack(spacing: 0) {
switch model.selectedTab {
case 0: TerminalEmulatorView(url: model.workspaceURL)
case 0:
TerminalEmulatorView(url: model.workspaceURL)
.background {
if colorScheme == .dark {
Comment thread
lukepistrol marked this conversation as resolved.
if prefs.preferences.theme.selectedTheme == prefs.preferences.theme.selectedLightTheme {
Color.white
} else {
EffectView(.underPageBackground)
}
} else {
if prefs.preferences.theme.selectedTheme == prefs.preferences.theme.selectedDarkTheme {
Color.black
} else {
EffectView(.contentBackground)
}

}
}
default: Rectangle().foregroundColor(Color(nsColor: .textBackgroundColor))
}
HStack(alignment: .center, spacing: 10) {
Expand Down
6 changes: 4 additions & 2 deletions CodeEdit/Features/TerminalEmulator/TerminalEmulatorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ struct TerminalEmulatorView: NSViewRepresentable {
terminal.caretColor = cursorColor
terminal.selectedTextBackgroundColor = selectionColor
terminal.nativeForegroundColor = textColor
terminal.nativeBackgroundColor = backgroundColor
terminal.nativeBackgroundColor = prefs.preferences.terminal.darkAppearance ? backgroundColor : .clear
terminal.layer?.backgroundColor = .clear
terminal.optionAsMetaKey = optionAsMeta
}
terminal.appearance = colorAppearance
Expand All @@ -201,7 +202,8 @@ struct TerminalEmulatorView: NSViewRepresentable {
view.caretColor = cursorColor
view.selectedTextBackgroundColor = selectionColor
view.nativeForegroundColor = textColor
view.nativeBackgroundColor = backgroundColor
view.nativeBackgroundColor = prefs.preferences.terminal.darkAppearance ? backgroundColor : .clear
view.layer?.backgroundColor = .clear
view.optionAsMetaKey = optionAsMeta
view.appearance = colorAppearance
if TerminalEmulatorView.lastTerminal[url.path] != nil {
Expand Down