Permalink
Browse files

Renamed uses of the 'rootView' property's ivar to '_rootView' (since …

…it's now implicitly synthesized), and remove the 'rootView' ivar from TUINSView that was masking the issue
  • Loading branch information...
1 parent 7ac3e8a commit 6f7c0847528120473f03d7448ed0d25b26e94d49 @jspahrsummers jspahrsummers committed Jul 18, 2012
Showing with 24 additions and 25 deletions.
  1. +1 −1 lib/UIKit/TUINSView+Accessibility.m
  2. +4 −4 lib/UIKit/TUINSView+Hyperfocus.m
  3. +0 −1 lib/UIKit/TUINSView.h
  4. +19 −19 lib/UIKit/TUINSView.m
@@ -16,7 +16,7 @@ - (id)accessibilityHitTest:(NSPoint)point
{
NSPoint windowPoint = [[self window] convertScreenToBase:point];
NSPoint localPoint = [self convertPoint:windowPoint fromView:nil];
- return [rootView accessibilityHitTest:localPoint];
+ return [self.rootView accessibilityHitTest:localPoint];
}
- (BOOL)accessibilityIsIgnored
@@ -43,10 +43,10 @@ - (void)hyperFocus:(TUIView *)focusView completion:(void(^)(BOOL))completion
CGRect focusRect = [focusView frameInNSView];
CGFloat startRadius = 1.0;
- CGFloat endRadius = MAX(rootView.bounds.size.width, rootView.bounds.size.height);
+ CGFloat endRadius = MAX(self.rootView.bounds.size.width, self.rootView.bounds.size.height);
CGPoint center = CGPointMake(focusRect.origin.x + focusRect.size.width * 0.5, focusRect.origin.y + focusRect.size.height * 0.5);
- TUIView *fade = [[TUIView alloc] initWithFrame:rootView.bounds];
+ TUIView *fade = [[TUIView alloc] initWithFrame:self.rootView.bounds];
fade.userInteractionEnabled = NO;
fade.autoresizingMask = TUIViewAutoresizingFlexibleSize;
fade.opaque = NO;
@@ -64,7 +64,7 @@ - (void)hyperFocus:(TUIView *)focusView completion:(void(^)(BOOL))completion
CGGradientRef gradient = CGGradientCreateWithColorComponents(space, components, locations, 3);
// CGContextSaveGState(ctx);
-// CGContextClipToRoundRect(ctx, rootView.bounds, 9);
+// CGContextClipToRoundRect(ctx, self.rootView.bounds, 9);
CGContextDrawRadialGradient(ctx, gradient, center, startRadius, center, endRadius, kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation);
// CGContextRestoreGState(ctx);
@@ -74,7 +74,7 @@ - (void)hyperFocus:(TUIView *)focusView completion:(void(^)(BOOL))completion
[CATransaction begin];
fade.alpha = 0.0;
- [rootView addSubview:fade];
+ [self.rootView addSubview:fade];
[CATransaction flush];
[CATransaction commit];
View
@@ -23,7 +23,6 @@
*/
@interface TUINSView : NSView <NSTextInputClient, TUIHostView>
{
- TUIView *rootView;
TUIView *_hoverView;
__unsafe_unretained TUIView *_trackingView; // dragging view, weak
View
@@ -142,10 +142,10 @@ - (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
- rootView.nsView = nil;
- [rootView removeFromSuperview];
+ _rootView.nsView = nil;
+ [_rootView removeFromSuperview];
- rootView = nil;
+ _rootView = nil;
_hoverView = nil;
_trackingView = nil;
_trackingArea = nil;
@@ -197,7 +197,7 @@ - (void)viewWillStartLiveResize
{
[super viewWillStartLiveResize];
inLiveResize = YES;
- [rootView viewWillStartLiveResize];
+ [_rootView viewWillStartLiveResize];
}
- (BOOL)inLiveResize
@@ -209,7 +209,7 @@ - (void)viewDidEndLiveResize
{
[super viewDidEndLiveResize];
inLiveResize = NO;
- [rootView viewDidEndLiveResize]; // will send to all subviews
+ [_rootView viewDidEndLiveResize]; // will send to all subviews
if([[self window] respondsToSelector:@selector(ensureWindowRectIsOnScreen)])
[[self window] performSelector:@selector(ensureWindowRectIsOnScreen)];
@@ -219,17 +219,17 @@ - (void)setRootView:(TUIView *)v
{
v.autoresizingMask = TUIViewAutoresizingFlexibleSize;
- rootView.nsView = nil;
- rootView.hostView = nil;
- rootView = v;
- rootView.nsView = self;
- rootView.hostView = self;
+ _rootView.nsView = nil;
+ _rootView.hostView = nil;
+ _rootView = v;
+ _rootView.nsView = self;
+ _rootView.hostView = self;
- [rootView setNextResponder:self];
+ [_rootView setNextResponder:self];
CGSize s = [self frame].size;
v.frame = CGRectMake(0, 0, s.width, s.height);
- [self.tuiHostView.layer addSublayer:rootView.layer];
+ [self.tuiHostView.layer addSublayer:_rootView.layer];
[self _updateLayerScaleFactor];
}
@@ -253,15 +253,15 @@ - (void)viewWillMoveToWindow:(NSWindow *)newWindow {
}
CALayer *hostLayer = self.tuiHostView.layer;
- if(newWindow != nil && rootView.layer.superlayer != hostLayer) {
- rootView.layer.frame = hostLayer.bounds;
- [hostLayer addSublayer:rootView.layer];
+ if(newWindow != nil && _rootView.layer.superlayer != hostLayer) {
+ _rootView.layer.frame = hostLayer.bounds;
+ [hostLayer addSublayer:_rootView.layer];
}
[self.rootView willMoveToWindow:(TUINSWindow *) newWindow];
if(newWindow == nil) {
- [rootView removeFromSuperview];
+ [_rootView removeFromSuperview];
}
}
@@ -305,7 +305,7 @@ - (void)screenProfileOrBackingPropertiesDidChange:(NSNotification *)notification
- (TUIView *)viewForLocalPoint:(NSPoint)p
{
- return [rootView hitTest:p withEvent:nil];
+ return [_rootView hitTest:p withEvent:nil];
}
- (NSPoint)localPointForLocationInWindow:(NSPoint)locationInWindow
@@ -532,12 +532,12 @@ - (void)keyDown:(NSEvent *)event
- (BOOL)performKeyEquivalent:(NSEvent *)event
{
- return [rootView performKeyEquivalent:event];
+ return [_rootView performKeyEquivalent:event];
}
- (void)setEverythingNeedsDisplay
{
- [rootView setEverythingNeedsDisplay];
+ [_rootView setEverythingNeedsDisplay];
}
- (BOOL)isTrackingSubviewOfView:(TUIView *)v

0 comments on commit 6f7c084

Please sign in to comment.