mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Adjust key view loop when adding a new document view to a NSClipView.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35631 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3e8bc54cd3
commit
81708584a5
2 changed files with 30 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-10-04 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSClipView.m (-setDocumentView:, -setNextKeyView:):
|
||||
Adjust key view loop when adding a new document view.
|
||||
|
||||
2012-10-03 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSWindow.m (titleWithRepresentedFilename,
|
||||
|
|
|
@ -125,6 +125,7 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
- (void) setDocumentView: (NSView*)aView
|
||||
{
|
||||
NSNotificationCenter *nc;
|
||||
NSView *nextKV;
|
||||
|
||||
if (_documentView == aView)
|
||||
{
|
||||
|
@ -134,6 +135,12 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
nc = [NSNotificationCenter defaultCenter];
|
||||
if (_documentView)
|
||||
{
|
||||
nextKV = [_documentView nextKeyView];
|
||||
if ([nextKV isDescendantOf: _documentView])
|
||||
{
|
||||
nextKV = nil;
|
||||
}
|
||||
|
||||
[nc removeObserver: self
|
||||
name: NSViewFrameDidChangeNotification
|
||||
object: _documentView];
|
||||
|
@ -152,6 +159,10 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
}
|
||||
[_documentView removeFromSuperview];
|
||||
}
|
||||
else
|
||||
{
|
||||
nextKV = [self nextKeyView];
|
||||
}
|
||||
|
||||
/* Don't retain this since it's stored in our subviews. */
|
||||
_documentView = aView;
|
||||
|
@ -193,7 +204,7 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
object: _documentView];
|
||||
|
||||
/*
|
||||
* if out document view is a tableview, let it know
|
||||
* if our document view is a tableview, let it know
|
||||
* when we resize
|
||||
*/
|
||||
if ([_documentView isKindOfClass: [NSTableView class]])
|
||||
|
@ -205,9 +216,12 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
object: self];
|
||||
}
|
||||
|
||||
[self setNextKeyView: _documentView];
|
||||
if (![_documentView nextKeyView])
|
||||
[_documentView setNextKeyView: nextKV];
|
||||
}
|
||||
|
||||
/* TODO: Adjust the key view loop to include the new document view */
|
||||
else
|
||||
[self setNextKeyView: nextKV];
|
||||
|
||||
[_super_view reflectScrolledClipView: self];
|
||||
}
|
||||
|
@ -722,6 +736,14 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
}
|
||||
}
|
||||
|
||||
- (void) setNextKeyView: (NSView *)aView
|
||||
{
|
||||
if (_documentView && aView != _documentView)
|
||||
[_documentView setNextKeyView: aView];
|
||||
else
|
||||
[super setNextKeyView: aView];
|
||||
}
|
||||
|
||||
/*
|
||||
* NSCoding protocol
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue