Skip to content

Commit

Permalink
Fix one more dark mode issue
Browse files Browse the repository at this point in the history
The `MZTextView` was not always setting the text color to
`NSColor.textColor`. This seems to be a bug fixed in later versions of
Xcode but since we still compile on High-Sierra we needed to find a fix.

The problem seemed to be that when the initial `textColor` and
`insertionPointColor` is `nil` (i.e. default color) the text color will
be wrong until the first time a non-empty string is shown from a loaded
value of any file or a search result. After the first color change the
value is correct.
  • Loading branch information
griff committed Mar 14, 2020
1 parent ed6b74a commit 7205db2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions App/src/MZTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ - (void)objectDidEndEditing:(id)theEditor

@implementation MZTextView

-(void)awakeFromNib {
self.textColor = NSColor.textColor;
self.insertionPointColor = NSColor.textColor;
}

-(void)setString:(NSString *)string
{
NSDictionary<NSAttributedStringKey, id>* defaultAttribute =
Expand Down

0 comments on commit 7205db2

Please sign in to comment.