mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Refine theme.
This commit is contained in:
parent
8da96e979c
commit
069c66e5e8
|
@ -27,8 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
self.delegate = self;
|
||||
|
||||
self.backgroundColor = [UIColor ows_light02Color];
|
||||
self.layer.borderColor = [UIColor.ows_blackColor colorWithAlphaComponent:0.12f].CGColor;
|
||||
self.backgroundColor = (Theme.isDarkThemeEnabled ? UIColor.ows_dark95Color : UIColor.ows_light02Color);
|
||||
self.layer.borderColor = [Theme.primaryColor colorWithAlphaComponent:0.12f].CGColor;
|
||||
self.layer.borderWidth = 0.5f;
|
||||
|
||||
self.scrollIndicatorInsets = UIEdgeInsetsMake(4, 4, 4, 4);
|
||||
|
@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
self.userInteractionEnabled = YES;
|
||||
|
||||
self.font = [UIFont ows_dynamicTypeBodyFont];
|
||||
self.textColor = [UIColor blackColor];
|
||||
self.textColor = Theme.primaryColor;
|
||||
self.textAlignment = NSTextAlignmentNatural;
|
||||
|
||||
self.contentMode = UIViewContentModeRedraw;
|
||||
|
@ -48,7 +48,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
self.placeholderView = [UILabel new];
|
||||
self.placeholderView.text = NSLocalizedString(@"new_message", @"");
|
||||
self.placeholderView.textColor = UIColor.ows_light35Color;
|
||||
self.placeholderView.textColor
|
||||
= (Theme.isDarkThemeEnabled ? UIColor.ows_dark55Color : UIColor.ows_light35Color);
|
||||
self.placeholderView.userInteractionEnabled = NO;
|
||||
[self addSubview:self.placeholderView];
|
||||
|
||||
|
|
|
@ -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,17 +80,28 @@ 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
|
||||
attributes:@{
|
||||
NSFontAttributeName : [UIFont ows_fontAwesomeFont:circleSize * 0.8f],
|
||||
NSForegroundColorAttributeName :
|
||||
(self.hasUnreadMessages ? [UIColor whiteColor] : [UIColor ows_materialBlueColor]),
|
||||
NSBaselineOffsetAttributeName : @(-0.5f),
|
||||
}];
|
||||
self.circleView.backgroundColor = backgroundColor;
|
||||
self.iconLabel.attributedText =
|
||||
[[NSAttributedString alloc] initWithString:self.iconText
|
||||
attributes:@{
|
||||
NSFontAttributeName : [UIFont ows_fontAwesomeFont:circleSize * 0.8f],
|
||||
NSForegroundColorAttributeName : foregroundColor,
|
||||
NSBaselineOffsetAttributeName : @(-0.5f),
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -141,8 +141,6 @@ import SignalMessaging
|
|||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
view.backgroundColor = UIColor.white
|
||||
|
||||
createViews()
|
||||
}
|
||||
|
||||
|
@ -150,6 +148,8 @@ import SignalMessaging
|
|||
|
||||
private func createViews() {
|
||||
|
||||
view.backgroundColor = UIColor.black
|
||||
|
||||
let contentView = UIView()
|
||||
contentView.backgroundColor = UIColor.black
|
||||
self.view.addSubview(contentView)
|
||||
|
|
Loading…
Reference in a new issue