* Source/NSTableView.m (-setFrame:,-setFrameSize:): Use

documentVisibleRect. Shrink if table is larger than needed height.
        fixes bug #18117.
        (-drawBackgroundInClipRect:): Draw the background.
        * Source/NSClipView.m (-documentVisibleRect:): Return the clip views
        visible rect converted to the document views coordinate system.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23972 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ratmice 2006-10-27 17:48:54 +00:00
parent 51474ab2d9
commit 9317defea6
3 changed files with 33 additions and 26 deletions

View file

@ -1,3 +1,12 @@
2006-10-27 Matt Rice <ratmice@yahoo.com>
* Source/NSTableView.m (-setFrame:,-setFrameSize:): Use
documentVisibleRect. Shrink if table is larger than needed height.
fixes bug #18117.
(-drawBackgroundInClipRect:): Draw the background.
* Source/NSClipView.m (-documentVisibleRect:): Return the clip views
visible rect converted to the document views coordinate system.
2006-10-24 Matt Rice <ratmice@yahoo.com> 2006-10-24 Matt Rice <ratmice@yahoo.com>
* Source/NSApplication.m (NSAppIcon -mouseDown:): Call unhide: * Source/NSApplication.m (NSAppIcon -mouseDown:): Call unhide:

View file

@ -462,26 +462,17 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
return rect; return rect;
} }
/**<p>Returns the document visible rectangle. Returns NSZeroRect if the /**<p>Returns the document visible rectangle in the document views coordinate
document view does not exists.</p> * system.
<p>See Also: -documentRect [NSView-convertRect:toView:]</p> <p>See Also: -documentRect [NSView-convertRect:toView:]</p>
*/ */
- (NSRect) documentVisibleRect - (NSRect) documentVisibleRect
{ {
NSRect documentBounds; NSRect visRect;
NSRect clipViewBounds;
NSRect rect; visRect = [self visibleRect];
visRect = [self convertRect:visRect toView:_documentView];
if (_documentView == nil) return visRect;
{
return NSZeroRect;
}
documentBounds = [_documentView bounds];
clipViewBounds = [self convertRect: _bounds toView: _documentView];
rect = NSIntersectionRect (documentBounds, clipViewBounds);
return rect;
} }
- (void) drawRect: (NSRect)rect - (void) drawRect: (NSRect)rect

View file

@ -4016,15 +4016,19 @@ static inline float computePeriod(NSPoint mouseLocationWin,
- (void) setFrame: (NSRect)frameRect - (void) setFrame: (NSRect)frameRect
{ {
NSRect tmpRect = frameRect; NSRect tmpRect = frameRect;
if ([_super_view respondsToSelector:@selector(documentVisibleRect)])
if ([_super_view respondsToSelector:@selector(documentRect)])
{ {
NSRect docRect = [(NSClipView *)_super_view documentRect]; float rowsHeight = ((_numberOfRows * _rowHeight) + 1);
NSRect docRect = [(NSClipView *)_super_view documentVisibleRect];
if (docRect.size.height > tmpRect.size.height) if (rowsHeight < docRect.size.height)
{ {
tmpRect.size.height = docRect.size.height; tmpRect.size.height = docRect.size.height;
} }
else
{
tmpRect.size.height = rowsHeight;
}
// TODO width? // TODO width?
} }
[super setFrame: tmpRect]; [super setFrame: tmpRect];
@ -4034,13 +4038,19 @@ static inline float computePeriod(NSPoint mouseLocationWin,
{ {
NSSize tmpSize = frameSize; NSSize tmpSize = frameSize;
if ([_super_view respondsToSelector:@selector(documentRect)]) if ([_super_view respondsToSelector:@selector(documentVisibleRect)])
{ {
NSRect docRect = [(NSClipView *)_super_view documentRect]; float rowsHeight = ((_numberOfRows * _rowHeight) + 1);
if (docRect.size.height > tmpSize.height) NSRect docRect = [(NSClipView *)_super_view documentVisibleRect];
if (rowsHeight < docRect.size.height)
{ {
tmpSize.height = docRect.size.height; tmpSize.height = docRect.size.height;
} }
else
{
tmpSize.height = rowsHeight;
}
// TODO width? // TODO width?
} }
[super setFrameSize: tmpSize]; [super setFrameSize: tmpSize];
@ -4687,11 +4697,8 @@ static inline float computePeriod(NSPoint mouseLocationWin,
- (void) drawBackgroundInClipRect: (NSRect)clipRect - (void) drawBackgroundInClipRect: (NSRect)clipRect
{ {
// FIXME
/*
[_backgroundColor set]; [_backgroundColor set];
NSRectFill (clipRect); NSRectFill (clipRect);
*/
} }
- (void) drawRect: (NSRect)aRect - (void) drawRect: (NSRect)aRect