From 747ea3c7b2af2b0f395cfe44c09e5292daf6de29 Mon Sep 17 00:00:00 2001 From: Nora Trapp Date: Thu, 13 Jun 2019 10:11:41 -0700 Subject: [PATCH 1/2] Theme cursor colors --- SignalMessaging/appearance/Theme.h | 2 ++ SignalMessaging/appearance/Theme.m | 5 +++++ SignalMessaging/utils/UIUtil.m | 3 +++ 3 files changed, 10 insertions(+) diff --git a/SignalMessaging/appearance/Theme.h b/SignalMessaging/appearance/Theme.h index 59c7c242cd..1358a4f3af 100644 --- a/SignalMessaging/appearance/Theme.h +++ b/SignalMessaging/appearance/Theme.h @@ -39,6 +39,8 @@ extern NSString *const ThemeDidChangeNotification; @property (class, readonly, nonatomic) UIColor *cellSelectedColor; @property (class, readonly, nonatomic) UIColor *cellSeparatorColor; +@property (class, readonly, nonatomic) UIColor *cursorColor; + // In some contexts, e.g. media viewing/sending, we always use "dark theme" UI regardless of the // users chosen theme. @property (class, readonly, nonatomic) UIColor *darkThemeNavbarIconColor; diff --git a/SignalMessaging/appearance/Theme.m b/SignalMessaging/appearance/Theme.m index 4a57fdc7c7..334c70da3a 100644 --- a/SignalMessaging/appearance/Theme.m +++ b/SignalMessaging/appearance/Theme.m @@ -168,6 +168,11 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled"; return Theme.hairlineColor; } ++ (UIColor *)cursorColor +{ + return Theme.isDarkThemeEnabled ? UIColor.ows_whiteColor : UIColor.ows_materialBlueColor; +} + + (UIColor *)darkThemeBackgroundColor { return UIColor.ows_gray95Color; diff --git a/SignalMessaging/utils/UIUtil.m b/SignalMessaging/utils/UIUtil.m index cbe8377aa9..916285eb9d 100644 --- a/SignalMessaging/utils/UIUtil.m +++ b/SignalMessaging/utils/UIUtil.m @@ -54,6 +54,9 @@ // If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored. UINavigationBar.appearance.titleTextAttributes = @{ NSForegroundColorAttributeName : Theme.navbarTitleColor }; + + UITextView.appearance.tintColor = Theme.cursorColor; + UITextField.appearance.tintColor = Theme.cursorColor; } @end From c530b22893005be6a21153ca811fa1135aa0d3d3 Mon Sep 17 00:00:00 2001 From: Nora Trapp Date: Thu, 13 Jun 2019 12:36:52 -0700 Subject: [PATCH 2/2] Put a background behind sticker suggestions to differentiate from incoming messages --- .../ViewControllers/ConversationView/ConversationInputToolbar.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index 91b03968aa..9bde74c01e 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -317,7 +317,7 @@ const CGFloat kMaxTextViewHeight = 98; _suggestedStickerView = [[StickerHorizontalListView alloc] initWithCellSize:suggestedStickerSize cellInset:0 spacing:suggestedStickerSpacing]; - self.suggestedStickerView.backgroundColor = UIColor.clearColor; + self.suggestedStickerView.backgroundColor = Theme.conversationButtonBackgroundColor; self.suggestedStickerView.contentInset = UIEdgeInsetsMake( suggestedStickerSpacing, suggestedStickerSpacing, suggestedStickerSpacing, suggestedStickerSpacing); self.suggestedStickerView.hidden = YES;