|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
//
|
|
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
|
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "ConversationScrollButton.h"
|
|
|
|
@ -54,7 +54,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
const CGFloat circleSize = self.class.circleSize;
|
|
|
|
|
UIView *circleView = [UIView new];
|
|
|
|
|
self.circleView = circleView;
|
|
|
|
|
circleView.backgroundColor = [UIColor colorWithWhite:0.95f alpha:1.f];
|
|
|
|
|
circleView.userInteractionEnabled = NO;
|
|
|
|
|
circleView.layer.cornerRadius = circleSize * 0.5f;
|
|
|
|
|
circleView.layer.shadowColor = [UIColor colorWithWhite:0.5f alpha:1.f].CGColor;
|
|
|
|
@ -81,15 +80,26 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
- (void)updateColors
|
|
|
|
|
{
|
|
|
|
|
UIColor *foregroundColor;
|
|
|
|
|
UIColor *backgroundColor;
|
|
|
|
|
if (self.hasUnreadMessages) {
|
|
|
|
|
foregroundColor = UIColor.whiteColor;
|
|
|
|
|
backgroundColor = UIColor.ows_materialBlueColor;
|
|
|
|
|
} else if (Theme.isDarkThemeEnabled) {
|
|
|
|
|
foregroundColor = UIColor.ows_materialBlueColor;
|
|
|
|
|
backgroundColor = [UIColor colorWithWhite:0.25f alpha:1.f];
|
|
|
|
|
} else {
|
|
|
|
|
foregroundColor = UIColor.ows_materialBlueColor;
|
|
|
|
|
backgroundColor = [UIColor colorWithWhite:0.95f alpha:1.f];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const CGFloat circleSize = self.class.circleSize;
|
|
|
|
|
self.circleView.backgroundColor
|
|
|
|
|
= (self.hasUnreadMessages ? [UIColor ows_materialBlueColor] : [UIColor colorWithWhite:0.95f alpha:1.f]);
|
|
|
|
|
self.iconLabel.attributedText = [[NSAttributedString alloc]
|
|
|
|
|
initWithString:self.iconText
|
|
|
|
|
self.circleView.backgroundColor = backgroundColor;
|
|
|
|
|
self.iconLabel.attributedText =
|
|
|
|
|
[[NSAttributedString alloc] initWithString:self.iconText
|
|
|
|
|
attributes:@{
|
|
|
|
|
NSFontAttributeName : [UIFont ows_fontAwesomeFont:circleSize * 0.8f],
|
|
|
|
|
NSForegroundColorAttributeName :
|
|
|
|
|
(self.hasUnreadMessages ? [UIColor whiteColor] : [UIColor ows_materialBlueColor]),
|
|
|
|
|
NSForegroundColorAttributeName : foregroundColor,
|
|
|
|
|
NSBaselineOffsetAttributeName : @(-0.5f),
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|