Merge pull request #6665 from vector-im/gil/6645-UI_glitches_in_dark_mode

UI glitches in dark mode
This commit is contained in:
Gil Eluard 2022-09-05 10:46:31 +02:00 committed by GitHub
commit d010cef9b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 6 deletions

View file

@ -44,6 +44,7 @@
{
[super customizeTableViewCellRendering];
self.contentView.backgroundColor = ThemeService.shared.theme.backgroundColor;
self.roomTitle.textColor = ThemeService.shared.theme.textPrimaryColor;
self.lastEventDescription.textColor = ThemeService.shared.theme.textSecondaryColor;
self.lastEventDate.textColor = ThemeService.shared.theme.textSecondaryColor;

View file

@ -48,6 +48,12 @@ class RecentsInvitesTableViewCell: UITableViewCell, NibReusable, Themable {
update(theme: ThemeService.shared().theme)
}
override func prepareForReuse() {
super.prepareForReuse()
update(theme: ThemeService.shared().theme)
}
// MARK: - Themable
func update(theme: Theme) {

View file

@ -95,6 +95,20 @@ class RoundedToastView: UIView, Themable {
layer.cornerRadius = layer.frame.height / 2
}
override func willMove(toSuperview newSuperview: UIView?) {
super.willMove(toSuperview: newSuperview)
if newSuperview != nil {
NotificationCenter.default.addObserver(self, selector: #selector(self.themeDidChange(notification:)), name: NSNotification.Name.themeServiceDidChangeTheme, object: nil)
} else {
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.themeServiceDidChangeTheme, object: nil)
}
}
@objc private func themeDidChange(notification: Notification) {
update(theme: ThemeService.shared().theme)
}
func update(theme: Theme) {
backgroundColor = theme.colors.system
stackView.arrangedSubviews.first?.tintColor = theme.colors.primaryContent

View file

@ -315,7 +315,8 @@ class AllChatsViewController: HomeViewController {
}
let sectionType = recentsDataSource.sections.sectionType(forSectionIndex: indexPath.section)
guard sectionType == .allChats, let numberOfRowsInSection = recentsDataSource.recentsListService.allChatsRoomListData?.counts.numberOfRooms, indexPath.row == numberOfRowsInSection - 1 else {
// We need to trottle a bit earlier so the next section is not visible even if the tableview scrolls faster
guard sectionType == .allChats, let numberOfRowsInSection = recentsDataSource.recentsListService.allChatsRoomListData?.counts.numberOfRooms, indexPath.row == numberOfRowsInSection - 4 else {
return
}

View file

@ -16,6 +16,8 @@
*/
#import "MXKRoomInputToolbarViewWithSimpleTextView.h"
#import "ThemeService.h"
#import "GeneratedInterface-Swift.h"
@implementation MXKRoomInputToolbarViewWithSimpleTextView
@ -39,7 +41,10 @@
[super customizeViewRendering];
// Set default message composer background color
self.messageComposerTextView.backgroundColor = [UIColor whiteColor];
self.messageComposerTextView.backgroundColor = ThemeService.shared.theme.backgroundColor;
self.backgroundColor = ThemeService.shared.theme.colors.system;
self.leftInputToolbarButton.tintColor = ThemeService.shared.theme.colors.accent;
self.rightInputToolbarButton.tintColor = ThemeService.shared.theme.colors.accent;
}
- (NSString*)textMessage

View file

@ -351,9 +351,9 @@ static CGSize kThreadListBarButtonItemImageSize;
[self setupRemoveJitsiWidgetRemoveView];
// Replace the default input toolbar view.
// Note: this operation will force the layout of subviews. That is why cell view classes must be registered before.
dispatch_async(dispatch_get_main_queue(), ^{
// Replace the default input toolbar view.
// Note: this operation will force the layout of subviews. That is why cell view classes must be registered before.
[self updateRoomInputToolbarViewClassIfNeeded];
});

View file

@ -150,7 +150,7 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" alpha="0.0" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QHs-rM-UU8" userLabel="scroll badge" customClass="BadgeLabel" customModule="Element" customModuleProvider="target">
<rect key="frame" x="331.5" y="556" width="17.5" height="16.5"/>
<rect key="frame" x="336.5" y="557.5" width="7.5" height="13.5"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="11"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@ -233,7 +233,7 @@
</objects>
<designables>
<designable name="QHs-rM-UU8">
<size key="intrinsicContentSize" width="17.5" height="16.5"/>
<size key="intrinsicContentSize" width="7.5" height="13.5"/>
</designable>
</designables>
<resources>

1
changelog.d/6645.bugfix Normal file
View file

@ -0,0 +1 @@
Fixed UI glitches in dark mode