From d23eaf3dd77e9ba1eb734367b315a62fc09cff09 Mon Sep 17 00:00:00 2001 From: CMK Date: Thu, 6 May 2021 16:43:54 +0800 Subject: [PATCH] fix: poll option view using wrong dark mode background color issue --- Mastodon/Scene/Share/View/Content/PollOptionView.swift | 7 ++++++- .../View/TableviewCell/PollOptionTableViewCell.swift | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Mastodon/Scene/Share/View/Content/PollOptionView.swift b/Mastodon/Scene/Share/View/Content/PollOptionView.swift index 7125b691..2a248ec3 100644 --- a/Mastodon/Scene/Share/View/Content/PollOptionView.swift +++ b/Mastodon/Scene/Share/View/Content/PollOptionView.swift @@ -82,7 +82,7 @@ final class PollOptionView: UIView { extension PollOptionView { private func _init() { // default color in the timeline - roundedBackgroundView.backgroundColor = Asset.Colors.Background.systemGroupedBackground.color + roundedBackgroundView.backgroundColor = Asset.Colors.Background.secondarySystemBackground.color roundedBackgroundView.translatesAutoresizingMaskIntoConstraints = false addSubview(roundedBackgroundView) @@ -193,6 +193,11 @@ struct PollOptionView_Previews: PreviewProvider { PollOptionView() } .previewLayout(.fixed(width: 375, height: 100)) + UIViewPreview(width: 375) { + PollOptionView() + } + .preferredColorScheme(.dark) + .previewLayout(.fixed(width: 375, height: 100)) } } diff --git a/Mastodon/Scene/Share/View/TableviewCell/PollOptionTableViewCell.swift b/Mastodon/Scene/Share/View/TableviewCell/PollOptionTableViewCell.swift index b067896a..957765e1 100644 --- a/Mastodon/Scene/Share/View/TableviewCell/PollOptionTableViewCell.swift +++ b/Mastodon/Scene/Share/View/TableviewCell/PollOptionTableViewCell.swift @@ -129,14 +129,16 @@ struct PollTableViewCell_Previews: PreviewProvider { } .previewLayout(.fixed(width: 375, height: 44 + 10)) } + .background(Color(.systemBackground)) } static var previews: some View { Group { - controls.colorScheme(.light) - controls.colorScheme(.dark) + controls + .colorScheme(.light) + controls + .colorScheme(.dark) } - .background(Color.gray) } }