mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 22:21:55 +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
|
- (void) drawRect: (NSRect)rect
|
||||||
{
|
{
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
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)
|
switch (_borderType)
|
||||||
{
|
{
|
||||||
|
@ -942,38 +927,34 @@ static float scrollerWidth;
|
||||||
|
|
||||||
[[NSColor controlDarkShadowColor] set];
|
[[NSColor controlDarkShadowColor] set];
|
||||||
DPSsetlinewidth(ctxt, 1);
|
DPSsetlinewidth(ctxt, 1);
|
||||||
|
|
||||||
if (_hasVertScroller)
|
if (_hasVertScroller)
|
||||||
{
|
{
|
||||||
horizLinePosition = scrollerWidth + border.width;
|
NSLog(@"VertScroller height:%f content height:%f",
|
||||||
horizLineLength -= scrollerWidth + 2 * border.width;
|
[_vertScroller frame].size.height, [self frame].size.height);
|
||||||
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;
|
|
||||||
|
|
||||||
if (_rFlags.flipped_view == NO)
|
DPSmoveto(ctxt, [_vertScroller frame].origin.x + scrollerWidth,
|
||||||
yStart = _bounds.size.height - yStart;
|
[_vertScroller frame].origin.y - 1);
|
||||||
DPSmoveto(ctxt, horizLinePosition, yStart);
|
DPSrlineto(ctxt, 0, [_vertScroller frame].size.height+1);
|
||||||
DPSlineto(ctxt, border.width, yStart);
|
|
||||||
DPSstroke(ctxt);
|
DPSstroke(ctxt);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (_hasHorizScroller)
|
if (_hasHorizScroller)
|
||||||
{
|
{
|
||||||
float ypos = scrollerWidth + border.height + 1;
|
float ypos;
|
||||||
|
float scrollerY = [_horizScroller frame].origin.y;
|
||||||
|
|
||||||
if (_rFlags.flipped_view)
|
if (_rFlags.flipped_view)
|
||||||
ypos = _bounds.size.height - ypos;
|
{
|
||||||
DPSmoveto(ctxt, horizLinePosition, ypos);
|
ypos = scrollerY - 1;
|
||||||
DPSrlineto(ctxt, horizLineLength - 1, 0);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ypos = scrollerY + scrollerWidth + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
DPSmoveto(ctxt, [_horizScroller frame].origin.x - 1, ypos);
|
||||||
|
DPSrlineto(ctxt, [_horizScroller frame].size.width + 1, 0);
|
||||||
DPSstroke(ctxt);
|
DPSstroke(ctxt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue