From 11fd195d5fe47d9e2cc298e18cdf40686e99cef9 Mon Sep 17 00:00:00 2001 From: Ehud Adler Date: Sat, 29 Sep 2018 23:35:51 -0400 Subject: [PATCH 1/3] Moves lock under divider --- .../Issues/IssueManagingContextController.swift | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Classes/Issues/IssueManagingContextController.swift b/Classes/Issues/IssueManagingContextController.swift index 1fe68cb79..f01c2b0aa 100644 --- a/Classes/Issues/IssueManagingContextController.swift +++ b/Classes/Issues/IssueManagingContextController.swift @@ -142,18 +142,26 @@ final class IssueManagingContextController: NSObject, ContextMenuDelegate { let separator: Bool switch action { - case .reopen, .close: separator = true + case .lock, .unlock: separator = true + case .reopen, .close: separator = permissions != .collaborator default: separator = false } let iconColor: UIColor switch action { + case .lock: iconColor = Styles.Colors.Gray.light.color case .close: iconColor = Styles.Colors.Red.medium.color default: iconColor = Styles.Colors.Blue.medium.color } - return ContrastContextMenuItem(title: title, iconName: iconName, iconColor: iconColor, - separator: separator, action: actionBlock(action)) + return ContrastContextMenuItem( + title: title, + iconName: iconName, + iconColor: + iconColor, + separator: separator, + action: actionBlock(action) + ) } From ecc591ac1d5917d0990966de3a321cff74cdc859 Mon Sep 17 00:00:00 2001 From: Ryan Nystrom Date: Sun, 30 Sep 2018 00:07:19 -0400 Subject: [PATCH 2/3] fix param style --- Classes/Issues/IssueManagingContextController.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Classes/Issues/IssueManagingContextController.swift b/Classes/Issues/IssueManagingContextController.swift index f01c2b0aa..a65ba4c5f 100644 --- a/Classes/Issues/IssueManagingContextController.swift +++ b/Classes/Issues/IssueManagingContextController.swift @@ -157,8 +157,7 @@ final class IssueManagingContextController: NSObject, ContextMenuDelegate { return ContrastContextMenuItem( title: title, iconName: iconName, - iconColor: - iconColor, + iconColor: iconColor, separator: separator, action: actionBlock(action) ) From a65f5a4ec7e9916af336b00bcba0ba04a49a5e41 Mon Sep 17 00:00:00 2001 From: Ryan Nystrom Date: Sun, 30 Sep 2018 00:09:01 -0400 Subject: [PATCH 3/3] Update IssueManagingContextController.swift --- Classes/Issues/IssueManagingContextController.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Classes/Issues/IssueManagingContextController.swift b/Classes/Issues/IssueManagingContextController.swift index a65ba4c5f..e15912edd 100644 --- a/Classes/Issues/IssueManagingContextController.swift +++ b/Classes/Issues/IssueManagingContextController.swift @@ -140,6 +140,8 @@ final class IssueManagingContextController: NSObject, ContextMenuDelegate { iconName = "x" } + // Lock always has the divider above it assuming you're a collaborator. + // If you aren't a collaborator (Lock does not show), close has the divider above it. let separator: Bool switch action { case .lock, .unlock: separator = true