mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Improve ASButtonNode layout invalidation
This commit is contained in:
@@ -61,11 +61,7 @@
|
||||
|
||||
_buttonNode = [[ASButtonNode alloc] init];
|
||||
[_buttonNode setTitle:buttonTitle withFont:buttonFont withColor:buttonColor forState:ASControlStateNormal];
|
||||
|
||||
// Note: Currently we have to set all the button properties to the same one as for ASControlStateNormal. Otherwise
|
||||
// if the button is involved in the layout transition it would break the transition as it does a layout pass
|
||||
// while changing the title. This needs and will be fixed in the future!
|
||||
[_buttonNode setTitle:buttonTitle withFont:buttonFont withColor:buttonColor forState:ASControlStateHighlighted];
|
||||
[_buttonNode setTitle:buttonTitle withFont:buttonFont withColor:[buttonColor colorWithAlphaComponent:0.5] forState:ASControlStateHighlighted];
|
||||
|
||||
|
||||
// Some debug colors
|
||||
@@ -80,7 +76,7 @@
|
||||
{
|
||||
[super didLoad];
|
||||
|
||||
[self.buttonNode addTarget:self action:@selector(buttonPressed:) forControlEvents:ASControlNodeEventTouchDown];
|
||||
[self.buttonNode addTarget:self action:@selector(buttonPressed:) forControlEvents:ASControlNodeEventTouchUpInside];
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
Reference in New Issue
Block a user