mirror of
https://github.com/danog/Telegram.git
synced 2024-12-02 09:27:55 +01:00
24 lines
824 B
Objective-C
24 lines
824 B
Objective-C
#import "TGHighlightableButton.h"
|
|
|
|
@implementation TGHighlightableButton
|
|
|
|
- (void)setHighlighted:(BOOL)highlighted
|
|
{
|
|
for (UIView *view in self.subviews)
|
|
{
|
|
if ([view isKindOfClass:[UILabel class]])
|
|
[(UILabel *)view setHighlighted:highlighted];
|
|
else if ([view isKindOfClass:[UIImageView class]])
|
|
[(UIImageView *)view setHighlighted:highlighted];
|
|
}
|
|
|
|
if (_reverseTitleShadow)
|
|
self.titleLabel.shadowOffset = highlighted ? CGSizeMake(-_normalTitleShadowOffset.width, -_normalTitleShadowOffset.height) : _normalTitleShadowOffset;
|
|
|
|
if (_normalBackgroundColor != nil && _highlightedBackgroundColor != nil)
|
|
self.backgroundColor = highlighted ? _highlightedBackgroundColor : _normalBackgroundColor;
|
|
|
|
[super setHighlighted:highlighted];
|
|
}
|
|
|
|
@end |