mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
[WIP] Colored profiles
This commit is contained in:
@@ -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 }) {
|
||||
|
||||
Reference in New Issue
Block a user