mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 07:01:22 +00:00
(drawRect): Calculate separator line usning scoller frame. Remove header view counting cases
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18343 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0839ec5546
commit
8a2660e3e4
1 changed files with 18 additions and 37 deletions
|
@ -905,21 +905,6 @@ static float scrollerWidth;
|
|||
- (void) drawRect: (NSRect)rect
|
||||
{
|
||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||
NSSize border = _sizeForBorderType(_borderType);
|
||||
float horizLinePosition = border.width;
|
||||
float horizLineLength = _bounds.size.width;
|
||||
float headerViewHeight = 0;
|
||||
|
||||
if (_hasHeaderView == YES)
|
||||
{
|
||||
headerViewHeight = [[_headerClipView documentView] frame].size.height;
|
||||
}
|
||||
if ((_hasCornerView == YES) && (_hasHorizScroller == YES)
|
||||
&& (headerViewHeight == 0))
|
||||
{
|
||||
headerViewHeight = [[(NSTableView *)[_contentView documentView]
|
||||
cornerView] frame].size.height;
|
||||
}
|
||||
|
||||
switch (_borderType)
|
||||
{
|
||||
|
@ -942,38 +927,34 @@ static float scrollerWidth;
|
|||
|
||||
[[NSColor controlDarkShadowColor] set];
|
||||
DPSsetlinewidth(ctxt, 1);
|
||||
|
||||
if (_hasVertScroller)
|
||||
{
|
||||
horizLinePosition = scrollerWidth + border.width;
|
||||
horizLineLength -= scrollerWidth + 2 * border.width;
|
||||
DPSmoveto(ctxt, horizLinePosition, border.height);
|
||||
if (_rFlags.flipped_view)
|
||||
{
|
||||
DPSrmoveto(ctxt, 0, headerViewHeight);
|
||||
}
|
||||
DPSrlineto(ctxt, 0, _bounds.size.height - headerViewHeight
|
||||
- 2 * border.height - 1);
|
||||
DPSstroke(ctxt);
|
||||
if ((_hasHeaderView == YES) && (_hasCornerView == NO))
|
||||
{
|
||||
float yStart = border.height + headerViewHeight - 1;
|
||||
NSLog(@"VertScroller height:%f content height:%f",
|
||||
[_vertScroller frame].size.height, [self frame].size.height);
|
||||
|
||||
if (_rFlags.flipped_view == NO)
|
||||
yStart = _bounds.size.height - yStart;
|
||||
DPSmoveto(ctxt, horizLinePosition, yStart);
|
||||
DPSlineto(ctxt, border.width, yStart);
|
||||
DPSmoveto(ctxt, [_vertScroller frame].origin.x + scrollerWidth,
|
||||
[_vertScroller frame].origin.y - 1);
|
||||
DPSrlineto(ctxt, 0, [_vertScroller frame].size.height+1);
|
||||
DPSstroke(ctxt);
|
||||
}
|
||||
}
|
||||
|
||||
if (_hasHorizScroller)
|
||||
{
|
||||
float ypos = scrollerWidth + border.height + 1;
|
||||
float ypos;
|
||||
float scrollerY = [_horizScroller frame].origin.y;
|
||||
|
||||
if (_rFlags.flipped_view)
|
||||
ypos = _bounds.size.height - ypos;
|
||||
DPSmoveto(ctxt, horizLinePosition, ypos);
|
||||
DPSrlineto(ctxt, horizLineLength - 1, 0);
|
||||
{
|
||||
ypos = scrollerY - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ypos = scrollerY + scrollerWidth + 1;
|
||||
}
|
||||
|
||||
DPSmoveto(ctxt, [_horizScroller frame].origin.x - 1, ypos);
|
||||
DPSrlineto(ctxt, [_horizScroller frame].size.width + 1, 0);
|
||||
DPSstroke(ctxt);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue