Adjust to fix corner view for scroillers on right.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24128 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-11-18 14:56:09 +00:00
parent 8854f61fe3
commit ae92dd8ca2
2 changed files with 28 additions and 17 deletions

View file

@ -1,3 +1,7 @@
2006-11-18 Richard Frith-Macdoanld <rfm@gnu.org>
* Source/NSScrollView.m: Adjust corner view when scroller is on right.
2006-11-17 Richard Frith-Macdoanld <rfm@gnu.org> 2006-11-17 Richard Frith-Macdoanld <rfm@gnu.org>
* Source/GSTheme.m: * Source/GSTheme.m:

View file

@ -832,6 +832,15 @@ static float scrollerWidth;
NSSize border = _sizeForBorderType(_borderType); NSSize border = _sizeForBorderType(_borderType);
NSRectEdge bottomEdge, topEdge; NSRectEdge bottomEdge, topEdge;
float headerViewHeight = 0; float headerViewHeight = 0;
NSRectEdge verticalScrollerEdge = NSMinXEdge;
NSInterfaceStyle style;
style = NSInterfaceStyleForKey(@"NSScrollViewInterfaceStyle", nil);
if (style == NSMacintoshInterfaceStyle
|| style == NSWindows95InterfaceStyle)
{
verticalScrollerEdge = NSMaxXEdge;
}
/* Determine edge positions. */ /* Determine edge positions. */
if (_rFlags.flipped_view) if (_rFlags.flipped_view)
@ -880,24 +889,15 @@ static float scrollerWidth;
if (_hasVertScroller) if (_hasVertScroller)
{ {
NSRect vertScrollerRect; NSRect vertScrollerRect;
NSRectEdge edge = NSMinXEdge;
NSInterfaceStyle style;
style = NSInterfaceStyleForKey(@"NSScrollViewInterfaceStyle", nil);
if (style == NSMacintoshInterfaceStyle
|| style == NSWindows95InterfaceStyle)
{
edge = NSMaxXEdge;
}
NSDivideRect (contentRect, &vertScrollerRect, &contentRect, NSDivideRect (contentRect, &vertScrollerRect, &contentRect,
scrollerWidth, edge); scrollerWidth, verticalScrollerEdge);
[_vertScroller setFrame: vertScrollerRect]; [_vertScroller setFrame: vertScrollerRect];
/* Substract 1 for the line that separates the vertical scroller /* Substract 1 for the line that separates the vertical scroller
* from the clip view (and eventually the horizontal scroller). */ * from the clip view (and eventually the horizontal scroller). */
NSDivideRect (contentRect, NULL, &contentRect, 1, edge); NSDivideRect (contentRect, NULL, &contentRect, 1, verticalScrollerEdge);
} }
/* Prepare the horizontal scroller. */ /* Prepare the horizontal scroller. */
@ -930,7 +930,13 @@ static float scrollerWidth;
/* Now place the corner view. */ /* Now place the corner view. */
if (_hasCornerView) if (_hasCornerView)
{ {
[_cornerView setFrameOrigin: headerRect.origin]; NSPoint p = headerRect.origin;
if (verticalScrollerEdge == NSMaxXEdge)
{
p.x += contentRect.size.width;
}
[_cornerView setFrameOrigin: p];
} }
/* Now place the rulers. */ /* Now place the rulers. */
@ -1040,12 +1046,12 @@ static float scrollerWidth;
return [_contentView backgroundColor]; return [_contentView backgroundColor];
} }
- (void)setDrawsBackground:(BOOL)flag - (void) setDrawsBackground: (BOOL)flag
{ {
[_contentView setDrawsBackground: flag]; [_contentView setDrawsBackground: flag];
} }
- (BOOL)drawsBackground - (BOOL) drawsBackground
{ {
return [_contentView drawsBackground]; return [_contentView drawsBackground];
} }
@ -1454,6 +1460,7 @@ static float scrollerWidth;
BOOL hadHeaderView = _hasHeaderView; BOOL hadHeaderView = _hasHeaderView;
BOOL hadCornerView = _hasCornerView; BOOL hadCornerView = _hasCornerView;
NSView *aView = nil; NSView *aView = nil;
_hasHeaderView = ([[self documentView] _hasHeaderView = ([[self documentView]
respondsToSelector: @selector(headerView)] respondsToSelector: @selector(headerView)]
&& (aView=[(NSTableView *)[self documentView] headerView])); && (aView=[(NSTableView *)[self documentView] headerView]));
@ -1484,7 +1491,7 @@ static float scrollerWidth;
{ {
if (hadCornerView == NO) if (hadCornerView == NO)
{ {
[self addSubview:aView]; [self addSubview: aView];
} }
else else
{ {