* Headers/Additions/GNUstepGUI/GSTheme.h: Remove GSScrollViewBottomCorner

part name, instead themes should just provide a part called NSScrollView.

	Add -scrollViewScrollersOverlapBorders method.

	* Source/GSTheme.m: Remove GSScrollViewBottomCorner part name.
	* Source/GSThemeDrawing.m: Add -scrollViewScrollersOverlapBorders.
	* Source/GSThemeDrawing.m (-drawBrowserRect:...): If
	-scrollViewScrollersOverlapBorders is enabled, fill the browser background
	with the NSScrollView tile.
	* Source/GSThemeDrawing.m (-drawScrollViewRect:...): If
	-scrollViewScrollersOverlapBorders is enabled, fill the scroll view background
	with the NSScrollView tile.
	* Source/NSScroller.m (-rectForPart:): Change the meaning of the
	GSScrollerKnobOvershoot default so the knob only overlaps the buttons
	by this much (rather than both ends of the track). Turns out this is more
	useful for themes.
	* Source/NSScrollView.m (-tile): Add support for
	-[GSTheme scrollViewScrollersOverlapBorders]
	* Source/NSBrowser.m (-tile): Add support for
	-[GSTheme scrollViewScrollersOverlapBorders] and
	-[GSTheme scrollViewUseBottomCorner]

	The overall point of these additions is to support NSScrollView and
	NSBrowser looking like: http://jesseross.com/clients/gnustep/ui/concepts/


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37238 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ericwa 2013-10-15 23:26:51 +00:00
parent 7ebdcd6517
commit 240f754c33
7 changed files with 209 additions and 54 deletions

View file

@ -68,8 +68,8 @@ static NSCell *horizontalKnobSlotCell = nil;
static NSCell *verticalKnobSlotCell = nil;
static CGFloat scrollerWidth = 0.0;
/**
* This is the amount (in userspace points) by which the knob slides beyond
* either end of the track. Typical use would be to set it to 1 when both
* This is the amount (in userspace points) by which the knob slides over the
* button ends of the track. Typical use would be to set it to 1 when both
* the knob and the buttons have a 1-point border, so that when the knob is
* at its maximum, it overlaps the button by 1 point giving a resulting
* 1-point wide border.
@ -1229,8 +1229,29 @@ static float buttonsOffset = 1.0; // buttonsWidth = sw - 2*buttonsOffset
knobHeight = buttonsWidth;
/* calc knob's position */
knobPosition = floor((float)_doubleValue * (slotHeight - knobHeight + (2 * scrollerKnobOvershoot)))
- scrollerKnobOvershoot;
{
CGFloat knobOvershootAbove = scrollerKnobOvershoot;
CGFloat knobOvershootBelow = scrollerKnobOvershoot;
if (arrowsSameEnd
&& _arrowsPosition == NSScrollerArrowsMinEnd)
{
knobOvershootBelow = 0;
}
else if (arrowsSameEnd
&& _arrowsPosition == NSScrollerArrowsMaxEnd)
{
knobOvershootAbove = 0;
}
else if (_arrowsPosition == NSScrollerArrowsNone)
{
knobOvershootAbove = 0;
knobOvershootBelow = 0;
}
knobPosition = floor((float)_doubleValue * (slotHeight - knobHeight + knobOvershootAbove + knobOvershootBelow))
- knobOvershootAbove;
}
if (arrowsSameEnd)
{