Context menu improvements

This commit is contained in:
Peter
2019-08-29 15:37:35 +04:00
parent 50c80f4daa
commit 05dacf8fe4
13 changed files with 200 additions and 61 deletions

View File

@@ -114,6 +114,21 @@ final class ContextActionsContainerNode: ASDisplayNode {
return CGSize(width: maxWidth, height: verticalOffset)
}
func updateTheme(theme: PresentationTheme) {
for itemNode in self.itemNodes {
switch itemNode {
case let .action(action):
action.updateTheme(theme: theme)
case let .separator(separator):
separator.backgroundColor = theme.contextMenu.sectionSeparatorColor
case let .itemSeparator(itemSeparator):
itemSeparator.backgroundColor = theme.contextMenu.itemSeparatorColor
}
}
self.backgroundColor = theme.contextMenu.backgroundColor
}
func actionNode(at point: CGPoint) -> ContextActionNode? {
for itemNode in self.itemNodes {
switch itemNode {