From 065056df81b049cba48b2d382aabcc267ac737a3 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 24 Feb 2020 09:31:13 +0700 Subject: [PATCH] WIP --- Signal/src/Loki/Components/SeedReminderView.swift | 2 +- Signal/src/Loki/View Controllers/NukeDataModal.swift | 6 ++++-- SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift | 4 ++++ SignalMessaging/Loki/Redesign/Style Guide/Colors.swift | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Signal/src/Loki/Components/SeedReminderView.swift b/Signal/src/Loki/Components/SeedReminderView.swift index 171b5d238..743f173c5 100644 --- a/Signal/src/Loki/Components/SeedReminderView.swift +++ b/Signal/src/Loki/Components/SeedReminderView.swift @@ -10,7 +10,7 @@ final class SeedReminderView : UIView { let result = UIProgressView() result.progressViewStyle = .bar result.progressTintColor = Colors.accent - result.backgroundColor = UIColor(hex: 0xFFFFFF).withAlphaComponent(0.1) + result.backgroundColor = isLightMode ? UIColor(hex: 0x000000).withAlphaComponent(0.1) : UIColor(hex: 0xFFFFFF).withAlphaComponent(0.1) result.set(.height, to: Values.progressBarThickness) return result }() diff --git a/Signal/src/Loki/View Controllers/NukeDataModal.swift b/Signal/src/Loki/View Controllers/NukeDataModal.swift index c7c962f58..39c7ab008 100644 --- a/Signal/src/Loki/View Controllers/NukeDataModal.swift +++ b/Signal/src/Loki/View Controllers/NukeDataModal.swift @@ -24,9 +24,11 @@ final class NukeDataModal : Modal { let nukeDataButton = UIButton() nukeDataButton.set(.height, to: Values.mediumButtonHeight) nukeDataButton.layer.cornerRadius = Values.modalButtonCornerRadius - nukeDataButton.backgroundColor = Colors.destructive + if isDarkMode { + nukeDataButton.backgroundColor = Colors.destructive + } nukeDataButton.titleLabel!.font = .systemFont(ofSize: Values.smallFontSize) - nukeDataButton.setTitleColor(Colors.text, for: UIControl.State.normal) + nukeDataButton.setTitleColor(isLightMode ? Colors.destructive : Colors.text, for: UIControl.State.normal) nukeDataButton.setTitle(NSLocalizedString("Delete", comment: ""), for: UIControl.State.normal) nukeDataButton.addTarget(self, action: #selector(nuke), for: UIControl.Event.touchUpInside) // Set up button stack view diff --git a/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift b/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift index bfa332a6f..318c863d3 100644 --- a/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift +++ b/SignalMessaging/Loki/Redesign/Style Guide/AppMode.swift @@ -8,3 +8,7 @@ public enum AppMode { public var isLightMode: Bool { return AppMode.current == .light } + +public var isDarkMode: Bool { + return AppMode.current == .dark +} diff --git a/SignalMessaging/Loki/Redesign/Style Guide/Colors.swift b/SignalMessaging/Loki/Redesign/Style Guide/Colors.swift index f03874db0..77a9d0340 100644 --- a/SignalMessaging/Loki/Redesign/Style Guide/Colors.swift +++ b/SignalMessaging/Loki/Redesign/Style Guide/Colors.swift @@ -27,7 +27,7 @@ public final class Colors : NSObject { @objc public static var unimportantButtonBackground = UIColor(hex: 0x323232) @objc public static var buttonBackground = isLightMode ? UIColor(hex: 0xFCFCFC) : UIColor(hex: 0x1B1B1B) @objc public static var settingButtonSelected = isLightMode ? UIColor(hex: 0xDFDFDF) : UIColor(hex: 0x0C0C0C) - @objc public static var modalBackground = UIColor(hex: 0x101011) + @objc public static var modalBackground = isLightMode ? UIColor(hex: 0xFCFCFC) : UIColor(hex: 0x101011) @objc public static var modalBorder = UIColor(hex: 0x212121) @objc public static var fakeChatBubbleBackground = isLightMode ? UIColor(hex: 0xFAFAFA) : UIColor(hex: 0x3F4146) @objc public static var fakeChatBubbleText = UIColor(hex: 0x000000)