зеркало из https://github.com/github/Rebel.git
use autolayout
This commit is contained in:
Родитель
72c50a4002
Коммит
9687f30d6b
|
@ -108,7 +108,7 @@ static CGFloat RBLRectsGetMedianY(CGRect r1, CGRect r2) {
|
|||
_clippingPath = clippingPath;
|
||||
CGPathRetain(_clippingPath);
|
||||
|
||||
self.needsDisplay = YES;
|
||||
self.needsLayout = YES;
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)dirtyRect {
|
||||
|
@ -618,41 +618,36 @@ static CGFloat const RBLPopoverBackgroundViewArrowWidth = 35.0;
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)setFrame:(NSRect)frameRect {
|
||||
[super setFrame:frameRect];
|
||||
[self rbl_updateClippingView];
|
||||
- (void)drawRect:(NSRect)rect {
|
||||
[super drawRect:rect];
|
||||
[self.fillColor set];
|
||||
NSRectFill(rect);
|
||||
}
|
||||
|
||||
- (void)setArrowSize:(CGSize)arrowSize {
|
||||
if (CGSizeEqualToSize(arrowSize, self.arrowSize)) return;
|
||||
_arrowSize = arrowSize;
|
||||
[self rbl_updateClippingView];
|
||||
self.needsLayout = YES;
|
||||
}
|
||||
|
||||
- (void)setPopoverEdge:(CGRectEdge)popoverEdge {
|
||||
if (popoverEdge == self.popoverEdge) return;
|
||||
_popoverEdge = popoverEdge;
|
||||
[self rbl_updateClippingView];
|
||||
self.needsLayout = YES;
|
||||
}
|
||||
|
||||
- (void)setPopoverOrigin:(NSRect)popoverOrigin {
|
||||
if (NSEqualRects(popoverOrigin, self.popoverOrigin)) return;
|
||||
_popoverOrigin = popoverOrigin;
|
||||
[self rbl_updateClippingView];
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)rect {
|
||||
[super drawRect:rect];
|
||||
[self.fillColor set];
|
||||
NSRectFill(rect);
|
||||
self.needsLayout = YES;
|
||||
}
|
||||
|
||||
- (BOOL)isOpaque {
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)viewDidMoveToWindow {
|
||||
[super viewDidMoveToWindow];
|
||||
- (void)layout {
|
||||
[super layout];
|
||||
[self rbl_updateClippingView];
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче