Skip to content

Commit

Permalink
Merge pull request #16 from Rminsh/main
Browse files Browse the repository at this point in the history
Change background of editor based on theme
  • Loading branch information
helje5 authored Jul 16, 2022
2 parents 9b888ab + e59cfe0 commit 180bde0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/CodeEditor/UXCodeTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ final class UXCodeTextView: UXTextView {
guard let highlightr = highlightr,
highlightr.setTheme(to: newTheme.rawValue),
let theme = highlightr.theme else { return false }
self.backgroundColor = theme.themeBackgroundColor
if let font = theme.codeFont, font !== self.font { self.font = font }
return true
}
Expand All @@ -263,6 +264,7 @@ final class UXCodeTextView: UXTextView {
theme.codeFont = theme.codeFont? .withSize(newSize)
theme.boldCodeFont = theme.boldCodeFont? .withSize(newSize)
theme.italicCodeFont = theme.italicCodeFont?.withSize(newSize)
self.backgroundColor = theme.themeBackgroundColor
if let font = theme.codeFont, font !== self.font { self.font = font }
return true
}
Expand Down

0 comments on commit 180bde0

Please sign in to comment.