Fix composer text coloration

This commit is contained in:
aringenbach
2022-05-13 16:40:47 +02:00
parent 932b9ad4e6
commit 9e4b5baaf7
2 changed files with 13 additions and 10 deletions

View File

@@ -117,6 +117,11 @@ static const NSTimeInterval kActionMenuComposerHeightAnimationDuration = .3;
self.textView.tintColor = ThemeService.shared.theme.tintColor;
self.textView.placeholderColor = ThemeService.shared.theme.textTertiaryColor;
self.textView.showsVerticalScrollIndicator = NO;
// Trigger textView redraw using proper color/font.
NSAttributedString *newText = self.textView.attributedText;
self.textView.attributedText = nil;
self.textView.attributedText = newText;
self.textView.keyboardAppearance = ThemeService.shared.theme.keyboardAppearance;
if (self.textView.isFirstResponder)
@@ -162,7 +167,11 @@ static const NSTimeInterval kActionMenuComposerHeightAnimationDuration = .3;
- (void)setAttributedTextMessage:(NSAttributedString *)attributedTextMessage
{
self.textView.attributedText = attributedTextMessage;
NSMutableAttributedString *mutableTextMessage = [[NSMutableAttributedString alloc] initWithAttributedString:attributedTextMessage];
[mutableTextMessage addAttributes:@{ NSForegroundColorAttributeName: ThemeService.shared.theme.textPrimaryColor,
NSFontAttributeName: self.textDefaultFont }
range:NSMakeRange(0, mutableTextMessage.length)];
self.textView.attributedText = mutableTextMessage;
[self updateUIWithAttributedTextMessage:attributedTextMessage animated:YES];
[self textViewDidChange:self.textView];
}