mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 05:26:48 +00:00
Merge pull request #75 from davbeck/master
Added tintColor convenience methods
This commit is contained in:
commit
8da4858c79
@ -474,6 +474,9 @@
|
|||||||
*/
|
*/
|
||||||
@property (atomic, retain) UIColor *backgroundColor; // default=nil
|
@property (atomic, retain) UIColor *backgroundColor; // default=nil
|
||||||
|
|
||||||
|
@property (atomic, retain) UIColor *tintColor; // default=Blue
|
||||||
|
- (void)tintColorDidChange; // Notifies the node when the tintColor has changed.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract A flag used to determine how a node lays out its content when its bounds change.
|
* @abstract A flag used to determine how a node lays out its content when its bounds change.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -48,6 +48,7 @@
|
|||||||
@property (nonatomic, getter=isHidden) BOOL hidden;
|
@property (nonatomic, getter=isHidden) BOOL hidden;
|
||||||
@property (nonatomic, assign) BOOL autoresizesSubviews;
|
@property (nonatomic, assign) BOOL autoresizesSubviews;
|
||||||
@property (nonatomic, assign) UIViewAutoresizing autoresizingMask;
|
@property (nonatomic, assign) UIViewAutoresizing autoresizingMask;
|
||||||
|
@property (nonatomic, retain) UIColor *tintColor;
|
||||||
@property (nonatomic, assign) CGFloat alpha;
|
@property (nonatomic, assign) CGFloat alpha;
|
||||||
@property (nonatomic, assign) CGRect bounds;
|
@property (nonatomic, assign) CGRect bounds;
|
||||||
@property (nonatomic, assign) UIViewContentMode contentMode;
|
@property (nonatomic, assign) UIViewContentMode contentMode;
|
||||||
|
|||||||
@ -213,4 +213,11 @@
|
|||||||
[_node asyncdisplaykit_asyncTransactionContainerStateDidChange];
|
[_node asyncdisplaykit_asyncTransactionContainerStateDidChange];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)tintColorDidChange
|
||||||
|
{
|
||||||
|
[super tintColorDidChange];
|
||||||
|
|
||||||
|
[_node tintColorDidChange];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -364,6 +364,25 @@
|
|||||||
_setToLayer(backgroundColor, backgroundColor.CGColor);
|
_setToLayer(backgroundColor, backgroundColor.CGColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (UIColor *)tintColor
|
||||||
|
{
|
||||||
|
_bridge_prologue;
|
||||||
|
ASDisplayNodeAssert(!_flags.isLayerBacked, @"Danger: this property is undefined on layer-backed nodes.");
|
||||||
|
return _getFromViewOnly(tintColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setTintColor:(UIColor *)color
|
||||||
|
{
|
||||||
|
_bridge_prologue;
|
||||||
|
ASDisplayNodeAssert(!_flags.isLayerBacked, @"Danger: this property is undefined on layer-backed nodes.");
|
||||||
|
_setToViewOnly(tintColor, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)tintColorDidChange
|
||||||
|
{
|
||||||
|
// ignore this, allow subclasses to be notified
|
||||||
|
}
|
||||||
|
|
||||||
- (CGColorRef)shadowColor
|
- (CGColorRef)shadowColor
|
||||||
{
|
{
|
||||||
_bridge_prologue;
|
_bridge_prologue;
|
||||||
|
|||||||
@ -61,6 +61,7 @@
|
|||||||
int setAutoresizingMask:1;
|
int setAutoresizingMask:1;
|
||||||
int setBounds:1;
|
int setBounds:1;
|
||||||
int setBackgroundColor:1;
|
int setBackgroundColor:1;
|
||||||
|
int setTintColor:1;
|
||||||
int setContents:1;
|
int setContents:1;
|
||||||
int setHidden:1;
|
int setHidden:1;
|
||||||
int setAlpha:1;
|
int setAlpha:1;
|
||||||
@ -109,6 +110,7 @@
|
|||||||
@synthesize edgeAntialiasingMask=edgeAntialiasingMask;
|
@synthesize edgeAntialiasingMask=edgeAntialiasingMask;
|
||||||
@synthesize autoresizesSubviews=autoresizesSubviews;
|
@synthesize autoresizesSubviews=autoresizesSubviews;
|
||||||
@synthesize autoresizingMask=autoresizingMask;
|
@synthesize autoresizingMask=autoresizingMask;
|
||||||
|
@synthesize tintColor=tintColor;
|
||||||
@synthesize alpha=alpha;
|
@synthesize alpha=alpha;
|
||||||
@synthesize contentMode=contentMode;
|
@synthesize contentMode=contentMode;
|
||||||
@synthesize anchorPoint=anchorPoint;
|
@synthesize anchorPoint=anchorPoint;
|
||||||
@ -148,6 +150,7 @@
|
|||||||
opaque = YES;
|
opaque = YES;
|
||||||
bounds = CGRectZero;
|
bounds = CGRectZero;
|
||||||
backgroundColor = nil;
|
backgroundColor = nil;
|
||||||
|
tintColor = [UIColor colorWithRed:0.0 green:0.478 blue:1.0 alpha:1.0];
|
||||||
contents = nil;
|
contents = nil;
|
||||||
isHidden = NO;
|
isHidden = NO;
|
||||||
needsDisplayOnBoundsChange = NO;
|
needsDisplayOnBoundsChange = NO;
|
||||||
@ -265,6 +268,12 @@
|
|||||||
_flags.setBackgroundColor = YES;
|
_flags.setBackgroundColor = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setTintColor:(UIColor *)newTintColor
|
||||||
|
{
|
||||||
|
tintColor = newTintColor;
|
||||||
|
_flags.setTintColor = YES;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setContents:(id)newContents
|
- (void)setContents:(id)newContents
|
||||||
{
|
{
|
||||||
if (contents == newContents) {
|
if (contents == newContents) {
|
||||||
@ -652,6 +661,9 @@
|
|||||||
if (_flags.setBackgroundColor)
|
if (_flags.setBackgroundColor)
|
||||||
layer.backgroundColor = backgroundColor;
|
layer.backgroundColor = backgroundColor;
|
||||||
|
|
||||||
|
if (_flags.setTintColor)
|
||||||
|
view.tintColor = self.tintColor;
|
||||||
|
|
||||||
if (_flags.setOpaque)
|
if (_flags.setOpaque)
|
||||||
view.layer.opaque = opaque;
|
view.layer.opaque = opaque;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user