diff --git a/Riot/Modules/Common/SectionHeaders/TabListView.swift b/Riot/Modules/Common/SectionHeaders/TabListView.swift index 2690c90ff..6508fac12 100644 --- a/Riot/Modules/Common/SectionHeaders/TabListView.swift +++ b/Riot/Modules/Common/SectionHeaders/TabListView.swift @@ -171,6 +171,8 @@ class TabListView: UIView { for (index, item) in items.enumerated() { let button = UIButton(type: .system) button.titleLabel?.font = itemFont + // Tchap: automatically adjust button font size dynamically when user change the setting. + button.vc_adjustsFontForContentSizeCategory = true button.setTitle(item.text, for: .normal) button.setImage(item.icon?.withRenderingMode(.alwaysTemplate), for: .normal) button.contentEdgeInsets = UIEdgeInsets(top: 0, left: Constants.itemSpacing / 2, bottom: 0, right: Constants.itemSpacing / 2) diff --git a/Riot/Modules/MatrixKit/Views/MXKMessageTextView.m b/Riot/Modules/MatrixKit/Views/MXKMessageTextView.m index ca572733a..e5d1b6153 100644 --- a/Riot/Modules/MatrixKit/Views/MXKMessageTextView.m +++ b/Riot/Modules/MatrixKit/Views/MXKMessageTextView.m @@ -27,6 +27,29 @@ @interface MXKMessageTextView() @implementation MXKMessageTextView +// Tchap: automatically adjust message font size dynamically when user change the setting. +- (id)initWithFrame:(CGRect)frame textContainer:(NSTextContainer *)textContainer +{ + self = [super initWithFrame:frame textContainer:textContainer]; + + if (self) { + [self setAdjustsFontForContentSizeCategory:YES]; + } + + return self; +} + +// Tchap: automatically adjust message font size dynamically when user change the setting. +- (id)initWithCoder:(NSCoder *)coder { + self = [super initWithCoder:coder]; + + if (self) { + [self setAdjustsFontForContentSizeCategory:YES]; + } + + return self; +} + - (BOOL)canBecomeFirstResponder { return NO; @@ -78,6 +101,9 @@ - (void)setAttributedText:(NSAttributedString *)attributedText // forcing the layoutManager to redraw the glyphs at all NSAttachment positions. [self vc_invalidateTextAttachmentsDisplay]; } + + // Tchap: set text type to prefered font to rerspect user text size + self.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; } - (void)registerPillView:(UIView *)pillView diff --git a/changelog.d/896.change b/changelog.d/896.change new file mode 100644 index 000000000..980dc0f71 --- /dev/null +++ b/changelog.d/896.change @@ -0,0 +1 @@ +Le texte des messages dans un salon respecte le réglage de taille de texte de l’utilisateur (possibilité de zoom) \ No newline at end of file