mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
* 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:
parent
37f70188f1
commit
d1397ca777
3 changed files with 33 additions and 26 deletions
|
@ -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>
|
||||
|
||||
* Source/NSApplication.m (NSAppIcon -mouseDown:): Call unhide:
|
||||
|
|
|
@ -462,26 +462,17 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
|
|||
return rect;
|
||||
}
|
||||
|
||||
/**<p>Returns the document visible rectangle. Returns NSZeroRect if the
|
||||
document view does not exists.</p>
|
||||
/**<p>Returns the document visible rectangle in the document views coordinate
|
||||
* system.
|
||||
<p>See Also: -documentRect [NSView-convertRect:toView:]</p>
|
||||
*/
|
||||
- (NSRect) documentVisibleRect
|
||||
{
|
||||
NSRect documentBounds;
|
||||
NSRect clipViewBounds;
|
||||
NSRect rect;
|
||||
|
||||
if (_documentView == nil)
|
||||
{
|
||||
return NSZeroRect;
|
||||
}
|
||||
|
||||
documentBounds = [_documentView bounds];
|
||||
clipViewBounds = [self convertRect: _bounds toView: _documentView];
|
||||
rect = NSIntersectionRect (documentBounds, clipViewBounds);
|
||||
|
||||
return rect;
|
||||
NSRect visRect;
|
||||
|
||||
visRect = [self visibleRect];
|
||||
visRect = [self convertRect:visRect toView:_documentView];
|
||||
return visRect;
|
||||
}
|
||||
|
||||
- (void) drawRect: (NSRect)rect
|
||||
|
|
|
@ -4016,15 +4016,19 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
|||
- (void) setFrame: (NSRect)frameRect
|
||||
{
|
||||
NSRect tmpRect = frameRect;
|
||||
|
||||
if ([_super_view respondsToSelector:@selector(documentRect)])
|
||||
if ([_super_view respondsToSelector:@selector(documentVisibleRect)])
|
||||
{
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
tmpRect.size.height = rowsHeight;
|
||||
}
|
||||
// TODO width?
|
||||
}
|
||||
[super setFrame: tmpRect];
|
||||
|
@ -4034,13 +4038,19 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
|||
{
|
||||
NSSize tmpSize = frameSize;
|
||||
|
||||
if ([_super_view respondsToSelector:@selector(documentRect)])
|
||||
if ([_super_view respondsToSelector:@selector(documentVisibleRect)])
|
||||
{
|
||||
NSRect docRect = [(NSClipView *)_super_view documentRect];
|
||||
if (docRect.size.height > tmpSize.height)
|
||||
float rowsHeight = ((_numberOfRows * _rowHeight) + 1);
|
||||
NSRect docRect = [(NSClipView *)_super_view documentVisibleRect];
|
||||
|
||||
if (rowsHeight < docRect.size.height)
|
||||
{
|
||||
tmpSize.height = docRect.size.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
tmpSize.height = rowsHeight;
|
||||
}
|
||||
// TODO width?
|
||||
}
|
||||
[super setFrameSize: tmpSize];
|
||||
|
@ -4687,11 +4697,8 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
|||
|
||||
- (void) drawBackgroundInClipRect: (NSRect)clipRect
|
||||
{
|
||||
// FIXME
|
||||
/*
|
||||
[_backgroundColor set];
|
||||
NSRectFill (clipRect);
|
||||
*/
|
||||
}
|
||||
|
||||
- (void) drawRect: (NSRect)aRect
|
||||
|
|
Loading…
Reference in a new issue