From 6c2fabaa039676821c33c62f1a7d5a8fbddb6195 Mon Sep 17 00:00:00 2001 From: Marcus Kida Date: Thu, 1 Dec 2022 14:52:55 +0100 Subject: [PATCH] chore: Fix hashtag follow button style --- .../HashtagTimelineHeaderView.swift | 16 ++++------------ .../HashtagTimelineHeaderViewActionButton.swift | 11 ++++++++++- .../Button/tagFollow.colorset/Contents.json | 8 ++++---- .../Button/tagUnfollow.colorset/Contents.json | 2 +- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderView.swift b/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderView.swift index 998b774b6..3af2cf07b 100644 --- a/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderView.swift +++ b/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderView.swift @@ -157,18 +157,10 @@ extension HashtagTimelineHeaderView { followButton.backgroundColor = entity.following == true ? Asset.Colors.Button.tagUnfollow.color : Asset.Colors.Button.tagFollow.color - switch traitCollection.userInterfaceStyle { - case .dark: - followButton.setTitleColor( - .lightGray, - for: .normal - ) - default: - followButton.setTitleColor( - entity.following == true ? Asset.Colors.Button.tagFollow.color : Asset.Colors.Button.tagUnfollow.color, - for: .normal - ) - } + followButton.setTitleColor( + entity.following == true ? Asset.Colors.Button.tagFollow.color : Asset.Colors.Button.tagUnfollow.color, + for: .normal + ) postCountLabel.text = String(entity.postCount) participantsLabel.text = String(entity.participantsCount) diff --git a/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderViewActionButton.swift b/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderViewActionButton.swift index aff97b21c..7efeb15d0 100644 --- a/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderViewActionButton.swift +++ b/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderViewActionButton.swift @@ -22,8 +22,17 @@ class HashtagTimelineHeaderViewActionButton: RoundedEdgesButton { public override func layoutSubviews() { super.layoutSubviews() + let shadowColor: UIColor = { + switch traitCollection.userInterfaceStyle { + case .dark: + return .darkGray + default: + return .lightGray + } + }() + layer.setupShadow( - color: .lightGray, + color: shadowColor, alpha: 1, x: 0, y: 1, diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Colors/Button/tagFollow.colorset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Colors/Button/tagFollow.colorset/Contents.json index 9bc42278d..e7e41c6ff 100644 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Colors/Button/tagFollow.colorset/Contents.json +++ b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Colors/Button/tagFollow.colorset/Contents.json @@ -22,10 +22,10 @@ "color" : { "color-space" : "srgb", "components" : { - "alpha" : "0.700", - "blue" : "0x38", - "green" : "0x29", - "red" : "0x2B" + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" } }, "idiom" : "universal" diff --git a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Colors/Button/tagUnfollow.colorset/Contents.json b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Colors/Button/tagUnfollow.colorset/Contents.json index 2790f171d..e7fbb60a6 100644 --- a/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Colors/Button/tagUnfollow.colorset/Contents.json +++ b/MastodonSDK/Sources/MastodonAsset/Assets.xcassets/Colors/Button/tagUnfollow.colorset/Contents.json @@ -22,7 +22,7 @@ "color" : { "color-space" : "srgb", "components" : { - "alpha" : "0.250", + "alpha" : "1.000", "blue" : "0x38", "green" : "0x29", "red" : "0x2B"