diff --git a/Riot/Managers/Theme/Theme.swift b/Riot/Managers/Theme/Theme.swift index a263e4299..2418cc967 100644 --- a/Riot/Managers/Theme/Theme.swift +++ b/Riot/Managers/Theme/Theme.swift @@ -32,6 +32,7 @@ import DesignKit var searchBackgroundColor: UIColor { get } var searchPlaceholderColor: UIColor { get } + var searchResultHighlightColor: UIColor { get } var headerBackgroundColor: UIColor { get } var headerBorderColor: UIColor { get } diff --git a/Riot/Managers/Theme/Themes/DarkTheme.swift b/Riot/Managers/Theme/Themes/DarkTheme.swift index 8bd94eafb..ebac661c8 100644 --- a/Riot/Managers/Theme/Themes/DarkTheme.swift +++ b/Riot/Managers/Theme/Themes/DarkTheme.swift @@ -33,6 +33,7 @@ class DarkTheme: NSObject, Theme { var searchBackgroundColor: UIColor = UIColor(rgb: 0x15191E) var searchPlaceholderColor: UIColor = UIColor(rgb: 0xA9B2BC) + var searchResultHighlightColor: UIColor = UIColor(rgb: 0xFCC639).withAlphaComponent(0.3) var headerBackgroundColor: UIColor = UIColor(rgb: 0x21262C) var headerBorderColor: UIColor = UIColor(rgb: 0x15191E) diff --git a/Riot/Managers/Theme/Themes/DefaultTheme.swift b/Riot/Managers/Theme/Themes/DefaultTheme.swift index 6e170cefa..2be798d23 100644 --- a/Riot/Managers/Theme/Themes/DefaultTheme.swift +++ b/Riot/Managers/Theme/Themes/DefaultTheme.swift @@ -33,6 +33,7 @@ class DefaultTheme: NSObject, Theme { var searchBackgroundColor: UIColor = UIColor(rgb: 0xFFFFFF) var searchPlaceholderColor: UIColor = UIColor(rgb: 0x8F97A3) + var searchResultHighlightColor: UIColor = UIColor(rgb: 0xFCC639).withAlphaComponent(0.2) var headerBackgroundColor: UIColor = UIColor(rgb: 0xF5F7FA) var headerBorderColor: UIColor = UIColor(rgb: 0xE9EDF1) diff --git a/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m b/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m index a9e230870..14a736b36 100644 --- a/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m +++ b/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m @@ -69,8 +69,8 @@ { // Highlight the search pattern [cellData highlightPatternInTextMessage:self.searchText - withBackgroundColor:[UIColor clearColor] - foregroundColor:ThemeService.shared.theme.tintColor + withBackgroundColor:ThemeService.shared.theme.searchResultHighlightColor + foregroundColor:ThemeService.shared.theme.textPrimaryColor andFont:patternFont]; // Use profile information as data to display diff --git a/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m b/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m index b4b25e1d4..5b99eea2d 100644 --- a/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m +++ b/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m @@ -75,8 +75,8 @@ { // Highlight the search pattern [cellData highlightPatternInTextMessage:self.searchText - withBackgroundColor:[UIColor clearColor] - foregroundColor:ThemeService.shared.theme.tintColor + withBackgroundColor:ThemeService.shared.theme.searchResultHighlightColor + foregroundColor:ThemeService.shared.theme.textPrimaryColor andFont:patternFont]; // Use profile information as data to display diff --git a/changelog.d/5252.change b/changelog.d/5252.change new file mode 100644 index 000000000..19d252751 --- /dev/null +++ b/changelog.d/5252.change @@ -0,0 +1 @@ +Search: display matching pattern with a highlight color \ No newline at end of file