summaryrefslogtreecommitdiff
path: root/cocoa/ScrollableView.m
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-02-09 00:34:47 +0000
committerVincent Sanders <vince@kyllikki.org>2016-02-09 00:34:47 +0000
commit2d2268f5dc2cc2c2be6ea24a08551cf8a38806b2 (patch)
tree10fb0ffee5e792405e6c1dd6d73b19ab5b8c1c32 /cocoa/ScrollableView.m
parent36d1ae479ba27bd03f17c7b304e340757fb3101a (diff)
downloadnetsurf-2d2268f5dc2cc2c2be6ea24a08551cf8a38806b2.tar.gz
netsurf-2d2268f5dc2cc2c2be6ea24a08551cf8a38806b2.tar.bz2
clean up cocoa warnings on os x yosemite sdk
Diffstat (limited to 'cocoa/ScrollableView.m')
-rw-r--r--cocoa/ScrollableView.m55
1 files changed, 29 insertions, 26 deletions
diff --git a/cocoa/ScrollableView.m b/cocoa/ScrollableView.m
index 63a675323..8f27b2b56 100644
--- a/cocoa/ScrollableView.m
+++ b/cocoa/ScrollableView.m
@@ -27,42 +27,45 @@
@implementation ScrollableView
@synthesize minimumSize;
-- (void) setMinimumSize: (NSSize)newSize;
+- (void) setMinimumSize: (NSSize)newSize
{
- minimumSize = newSize;
- [self adjustFrame];
+ minimumSize = newSize;
+ [self adjustFrame];
}
-- (void) adjustFrame;
+- (void) adjustFrame
{
- NSSize frameSize = [[self superview] frame].size;
- [self setFrameSize: NSMakeSize( MAX( minimumSize.width, frameSize.width ),
- MAX( minimumSize.height, frameSize.height ) )];
+ NSSize frameSize = [[self superview] frame].size;
+ [self setFrameSize: NSMakeSize( MAX( minimumSize.width, frameSize.width ),
+ MAX( minimumSize.height, frameSize.height ) )];
}
-- (void) frameChangeNotification: (NSNotification *) note;
+- (void) frameChangeNotification: (NSNotification *) note
{
- [self adjustFrame];
+ [self adjustFrame];
}
-- (void) viewDidMoveToSuperview;
+- (void) viewDidMoveToSuperview
{
- if (observedSuperview) {
- [[NSNotificationCenter defaultCenter] removeObserver: self
- name: NSViewFrameDidChangeNotification
- object: observedSuperview];
- observedSuperview = nil;
- }
-
- NSView *newSuperView = [self superview];
-
- if (nil != newSuperView) {
- observedSuperview = newSuperView;
- [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(frameChangeNotification:)
- name: NSViewFrameDidChangeNotification
- object: observedSuperview];
- [observedSuperview setPostsFrameChangedNotifications: YES];
- }
+ if (observedSuperview) {
+ [[NSNotificationCenter defaultCenter]
+ removeObserver: self
+ name: NSViewFrameDidChangeNotification
+ object: observedSuperview];
+ observedSuperview = nil;
+ }
+
+ NSView *newSuperView = [self superview];
+
+ if (nil != newSuperView) {
+ observedSuperview = newSuperView;
+ [[NSNotificationCenter defaultCenter]
+ addObserver: self
+ selector: @selector(frameChangeNotification:)
+ name: NSViewFrameDidChangeNotification
+ object: observedSuperview];
+ [observedSuperview setPostsFrameChangedNotifications: YES];
+ }
}
@end