From 05697b12cc75bbe49aa97be28bad3e4aa6f77b32 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 21 Nov 2019 15:08:05 +0100 Subject: [PATCH] Use primary color for normal actions --- Passepartout-iOS/Global/Theme.swift | 6 ++++++ Passepartout-iOS/Scenes/ProviderPoolViewController.swift | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Passepartout-iOS/Global/Theme.swift b/Passepartout-iOS/Global/Theme.swift index 85d059e2..f60aeaaa 100644 --- a/Passepartout-iOS/Global/Theme.swift +++ b/Passepartout-iOS/Global/Theme.swift @@ -170,6 +170,12 @@ extension UIBarButtonItem { } } +extension UIContextualAction { + func applyNormal(_ theme: Theme) { + backgroundColor = theme.palette.primaryBackground + } +} + // XXX: status bar is broken extension MFMailComposeViewController { func apply(_ theme: Theme) { diff --git a/Passepartout-iOS/Scenes/ProviderPoolViewController.swift b/Passepartout-iOS/Scenes/ProviderPoolViewController.swift index 0cfd94c9..31f74558 100644 --- a/Passepartout-iOS/Scenes/ProviderPoolViewController.swift +++ b/Passepartout-iOS/Scenes/ProviderPoolViewController.swift @@ -247,12 +247,13 @@ extension ProviderPoolViewController: UITableViewDataSource, UITableViewDelegate self.favoriteGroup(withId: groupId) $2(true) } + action.applyNormal(.current) } else { return nil } let cfg = UISwipeActionsConfiguration(actions: [action]) - cfg.performsFirstActionWithFullSwipe = true + cfg.performsFirstActionWithFullSwipe = false return cfg }