diff --git a/ChangeLog b/ChangeLog index 1463acb6f..fc09b41e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-07-16 Doug Simons + + * Source/NSSplitView.m: Add userInfo dictionary containing the + divider number in resize notifications, as added in OSX 10.5. + 2015-07-02 Doug Simons * Source/NSTableView.m: Changed click and double-click behavior @@ -6,7 +11,7 @@ doubleAction if there is one, and only begin editing if there is no doubleAction assigned. - 2015-07-01 Doug Simons +2015-07-01 Doug Simons * Source/NSTextStorage.m: Fixed a bug with setting _editedRange for multiple edits when the first one is a delete (which results in diff --git a/Source/NSSplitView.m b/Source/NSSplitView.m index b043834af..45438b08c 100644 --- a/Source/NSSplitView.m +++ b/Source/NSSplitView.m @@ -325,12 +325,13 @@ static NSNotificationCenter *nc = nil; - (void) _resize: (id) v withOldSplitView: (id) prev withFrame: (NSRect) r fromPoint: (NSPoint) p withBigRect: (NSRect) bigRect divHorizontal: (CGFloat) divHorizontal - divVertical: (CGFloat) divVertical + divVertical: (CGFloat) divVertical userInfo:(NSDictionary *)userInfo { NSRect r1 = NSZeroRect; [nc postNotificationName: NSSplitViewWillResizeSubviewsNotification - object: self]; + object: self + userInfo: userInfo]; /* resize the subviews accordingly */ r = [prev frame]; @@ -387,7 +388,8 @@ static NSNotificationCenter *nc = nil; (int)NSHeight(r1)); [nc postNotificationName: NSSplitViewDidResizeSubviewsNotification - object: self]; + object: self + userInfo: userInfo]; } @@ -424,6 +426,7 @@ static NSNotificationCenter *nc = nil; NSRect oldRect; //only one can be dragged at a time BOOL lit = NO; NSCursor *cursor; + NSDictionary *userInfo = nil; // userInfo for resize notifications /* if there are less the two subviews, there is nothing to do */ if (count < 2) @@ -615,6 +618,7 @@ static NSNotificationCenter *nc = nil; // Save the old position op = p; } + userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:offset] forKey:@"NSSplitViewDividerIndex"]; // user is moving the knob loop until left mouse up while ([e type] != NSLeftMouseUp) @@ -714,7 +718,7 @@ static NSNotificationCenter *nc = nil; { [self _resize: v withOldSplitView: prev withFrame: r fromPoint: p withBigRect: bigRect divHorizontal: divHorizontal - divVertical: divVertical]; + divVertical: divVertical userInfo:userInfo]; [_window invalidateCursorRectsForView: self]; [self setNeedsDisplay: YES]; } @@ -740,7 +744,7 @@ static NSNotificationCenter *nc = nil; { [self _resize: v withOldSplitView: prev withFrame: r fromPoint: p withBigRect: bigRect divHorizontal: divHorizontal - divVertical: divVertical]; + divVertical: divVertical userInfo:userInfo]; [_window invalidateCursorRectsForView: self]; } }