replaced UIColor link with ThemeService links color everywhere it was used, and included the ThemeService in NSE and SiriIntents

This commit is contained in:
Mauro Romito
2023-01-12 17:54:44 +01:00
parent 2bb571e088
commit 4c81b71afd
6 changed files with 11 additions and 4 deletions

View File

@@ -51,7 +51,7 @@ class HTMLFormatter: NSObject {
DTDefaultFontName: font.fontName,
DTDefaultFontSize: font.pointSize,
DTDefaultLinkDecoration: false,
DTDefaultLinkColor: UIColor.link,
DTDefaultLinkColor: ThemeService.shared().theme.colors.links,
DTWillFlushBlockCallBack: sanitizeCallback
]
options.merge(extraOptions) { (_, new) in new }

View File

@@ -1052,7 +1052,7 @@ manualChangeMessageForVideo:(NSString*)manualChangeMessageForVideo
NSURLComponents *url = [[NSURLComponents new] initWithURL:matchUrl resolvingAgainstBaseURL:NO];
if (url.URL)
{
[mutableAttributedString addAttribute:NSForegroundColorAttributeName value:[UIColor linkColor] range:matchRange];
[mutableAttributedString addAttribute:NSForegroundColorAttributeName value:ThemeService.shared.theme.colors.links range:matchRange];
}
}
}
@@ -1103,7 +1103,7 @@ manualChangeMessageForVideo:(NSString*)manualChangeMessageForVideo
if (NSIntersectionRange(match.range, linkMatch.range).length == match.range.length)
{
// but before we set the right color
[mutableAttributedString addAttribute:NSForegroundColorAttributeName value:[UIColor linkColor] range:linkMatch.range];
[mutableAttributedString addAttribute:NSForegroundColorAttributeName value:ThemeService.shared.theme.colors.links range:linkMatch.range];
hasAlreadyLink = YES;
break;
}
@@ -1118,7 +1118,7 @@ manualChangeMessageForVideo:(NSString*)manualChangeMessageForVideo
NSString *link = [mutableAttributedString.string substringWithRange:match.range];
link = [link stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
[mutableAttributedString addAttribute:NSLinkAttributeName value:link range:match.range];
[mutableAttributedString addAttribute:NSForegroundColorAttributeName value:[UIColor linkColor] range:match.range];
[mutableAttributedString addAttribute:NSForegroundColorAttributeName value:ThemeService.shared.theme.colors.links range:match.range];
}
}];
}

View File

@@ -23,4 +23,6 @@
#import "BuildInfo.h"
#import "ThemeService.h"
#endif /* RiotNSE_Bridging_Header_h */

View File

@@ -78,3 +78,5 @@ targets:
- "**/*.md" # excludes all files with the .md extension
- path: ../Riot/Modules/Room/TimelineCells/Styles/RoomTimelineStyleIdentifier.swift
- path: ../Riot/Modules/VoiceBroadcast/VoiceBroadcastSDK/MatrixSDK
- path: ../Riot/Managers/Theme
- path: ../Riot/Categories/UIColor.swift

View File

@@ -16,3 +16,4 @@
#import "MatrixKit-Bridging-Header.h"
#import "BuildInfo.h"
#import "ThemeService.h"

View File

@@ -66,3 +66,5 @@ targets:
- "**/*.md" # excludes all files with the .md extension
- path: ../Riot/Modules/Room/TimelineCells/Styles/RoomTimelineStyleIdentifier.swift
- path: ../Riot/Modules/VoiceBroadcast/VoiceBroadcastSDK/MatrixSDK
- path: ../Riot/Managers/Theme
- path: ../Riot/Categories/UIColor.swift