diff --git a/Riot/Utils/EventFormatter.m b/Riot/Utils/EventFormatter.m index bccb635f4..91370a3be 100644 --- a/Riot/Utils/EventFormatter.m +++ b/Riot/Utils/EventFormatter.m @@ -69,19 +69,17 @@ localTimeZone = [NSTimeZone localTimeZone]; - CGFloat white = 1.0; - [kRiotSecondaryBgColor getWhite:&white alpha:nil]; - NSUInteger whiteComponent = (white * 255); - + // Use the secondary bg color to set the background color in the default CSS. + NSUInteger bgColor = [MXKTools rgbValueWithColor:kRiotSecondaryBgColor]; self.defaultCSS = [NSString stringWithFormat:@" \ pre,code { \ - background-color: #%02lX%02lX%02lX; \ + background-color: #%06lX; \ display: inline; \ font-family: monospace; \ white-space: pre; \ -coretext-fontname: Menlo-Regular; \ font-size: small; \ - }", whiteComponent, whiteComponent, whiteComponent]; + }", bgColor]; self.defaultTextColor = kRiotPrimaryTextColor; self.subTitleTextColor = kRiotSecondaryTextColor; diff --git a/Riot/ViewController/WebViewViewController.m b/Riot/ViewController/WebViewViewController.m index b53ac97a3..88536d9f6 100644 --- a/Riot/ViewController/WebViewViewController.m +++ b/Riot/ViewController/WebViewViewController.m @@ -63,4 +63,15 @@ return kRiotDesignStatusBarStyle; } +- (void)destroy +{ + if (kRiotDesignValuesDidChangeThemeNotificationObserver) + { + [[NSNotificationCenter defaultCenter] removeObserver:kRiotDesignValuesDidChangeThemeNotificationObserver]; + kRiotDesignValuesDidChangeThemeNotificationObserver = nil; + } + + [super destroy]; +} + @end