зеркало из https://github.com/nextcloud/talk-ios.git
Use color-element in mentions.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Родитель
8b20ff00e3
Коммит
e2cb882fe0
|
@ -44,6 +44,7 @@ extern BOOL const customNavigationLogo;
|
|||
+ (UIColor *)brandTextColor;
|
||||
+ (UIColor *)themeColor;
|
||||
+ (UIColor *)themeTextColor;
|
||||
+ (UIColor *)elementColor;
|
||||
+ (NSString *)navigationLogoImageName;
|
||||
+ (UIColor *)placeholderColor;
|
||||
+ (UIStatusBarStyle)statusBarStyleForBrandColor;
|
||||
|
|
|
@ -87,6 +87,19 @@ BOOL const useServerThemimg = YES;
|
|||
return textColor;
|
||||
}
|
||||
|
||||
+ (UIColor *)elementColor
|
||||
{
|
||||
UIColor *elementColor = [NCUtils colorFromHexString:brandColorHex];
|
||||
// Do not check if using server theming or not for now
|
||||
// We could check it once we calculate color element locally
|
||||
TalkAccount *activeAccount = [[NCDatabaseManager sharedInstance] activeAccount];
|
||||
ServerCapabilities *serverCapabilities = [[NCDatabaseManager sharedInstance] serverCapabilitiesForAccountId:activeAccount.accountId];
|
||||
if (serverCapabilities && ![serverCapabilities.colorElement isEqualToString:@""]) {
|
||||
elementColor = [NCUtils colorFromHexString:serverCapabilities.colorElement];
|
||||
}
|
||||
return elementColor;
|
||||
}
|
||||
|
||||
+ (NSString *)navigationLogoImageName
|
||||
{
|
||||
NSString *imageName = @"navigationLogo";
|
||||
|
|
|
@ -199,7 +199,7 @@ NSInteger const kChatMessageGroupTimeDifference = 30;
|
|||
//Set color for mentions
|
||||
if ([param.type isEqualToString:@"user"] || [param.type isEqualToString:@"guest"] || [param.type isEqualToString:@"call"]) {
|
||||
UIColor *defaultColor = [UIColor darkGrayColor];
|
||||
UIColor *highlightedColor = [NCAppBranding themeColor];
|
||||
UIColor *highlightedColor = [NCAppBranding elementColor];
|
||||
[attributedMessage addAttribute:NSForegroundColorAttributeName value:(param.shouldBeHighlighted) ? highlightedColor : defaultColor range:param.range];
|
||||
[attributedMessage addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:16.0f] range:param.range];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче