mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-19 01:06:30 +00:00
Merge branch 'master' into CollectionRefactoring
This commit is contained in:
@@ -31,6 +31,17 @@ typedef enum : NSUInteger {
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL laysOutHorizontally;
|
||||
|
||||
/** Horizontally align content (text or image).
|
||||
Defaults to ASAlignmentMiddle.
|
||||
*/
|
||||
@property (nonatomic, assign) ASHorizontalAlignment contentHorizontalAlignment;
|
||||
|
||||
/** Vertically align content (text or image).
|
||||
Defaults to ASAlignmentCenter.
|
||||
*/
|
||||
@property (nonatomic, assign) ASVerticalAlignment contentVerticalAlignment;
|
||||
|
||||
|
||||
- (NSAttributedString *)attributedTitleForState:(ASButtonState)state;
|
||||
- (void)setAttributedTitle:(NSAttributedString *)title forState:(ASButtonState)state;
|
||||
|
||||
|
||||
@@ -39,6 +39,9 @@
|
||||
_titleNode = [[ASTextNode alloc] init];
|
||||
_imageNode = [[ASImageNode alloc] init];
|
||||
|
||||
_contentHorizontalAlignment = ASAlignmentMiddle;
|
||||
_contentVerticalAlignment = ASAlignmentCenter;
|
||||
|
||||
[self addSubnode:_titleNode];
|
||||
[self addSubnode:_imageNode];
|
||||
|
||||
@@ -195,8 +198,8 @@
|
||||
ASStackLayoutSpec *stack = [[ASStackLayoutSpec alloc] init];
|
||||
stack.direction = self.laysOutHorizontally ? ASStackLayoutDirectionHorizontal : ASStackLayoutDirectionVertical;
|
||||
stack.spacing = self.contentSpacing;
|
||||
stack.justifyContent = ASStackLayoutJustifyContentCenter;
|
||||
stack.alignItems = ASStackLayoutAlignItemsCenter;
|
||||
stack.horizontalAlignment = _contentHorizontalAlignment;
|
||||
stack.verticalAlignment = _contentVerticalAlignment;
|
||||
|
||||
NSMutableArray *children = [[NSMutableArray alloc] initWithCapacity:2];
|
||||
if (self.imageNode.image) {
|
||||
|
||||
Reference in New Issue
Block a user