[WIP] Colored profiles

This commit is contained in:
Isaac
2023-11-22 01:05:47 +04:00
parent 2d01508e55
commit 66b3d8b874
69 changed files with 1626 additions and 529 deletions

View File

@@ -338,6 +338,10 @@ public final class NavigationButtonNode: ContextControllerSourceNode {
return nil
}
public var mainContentNode: ASDisplayNode? {
return self.nodes.first
}
public var pressed: (Int) -> () = { _ in }
public var highlightChanged: (Int, Bool) -> () = { _, _ in }
@@ -397,6 +401,8 @@ public final class NavigationButtonNode: ContextControllerSourceNode {
}
}
public var contentsColor: UIColor?
public func updateManualAlpha(alpha: CGFloat, transition: ContainedViewLayoutTransition) {
for node in self.nodes {
transition.updateAlpha(node: node, alpha: alpha)
@@ -411,6 +417,7 @@ public final class NavigationButtonNode: ContextControllerSourceNode {
node = NavigationButtonItemNode()
node.color = self.color
node.rippleColor = self.rippleColor
node.layer.layerTintColor = self.contentsColor?.cgColor
node.highlightChanged = { [weak node, weak self] value in
if let strongSelf = self, let node = node {
if let index = strongSelf.nodes.firstIndex(where: { $0 === node }) {
@@ -454,6 +461,7 @@ public final class NavigationButtonNode: ContextControllerSourceNode {
node = NavigationButtonItemNode()
node.color = self.color
node.rippleColor = self.rippleColor
node.layer.layerTintColor = self.contentsColor?.cgColor
node.highlightChanged = { [weak node, weak self] value in
if let strongSelf = self, let node = node {
if let index = strongSelf.nodes.firstIndex(where: { $0 === node }) {