mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 03:11:18 +00:00
* Source/NSScroller.m: Add GSScrollerKnobOvershoot default which
allows themes to make the scroller knob overlap the scroller buttons by a specified amount. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37162 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b8217cb63e
commit
894b5b0059
2 changed files with 24 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2013-09-28 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSScroller.m: Add GSScrollerKnobOvershoot default which
|
||||
allows themes to make the scroller knob overlap the scroller buttons
|
||||
by a specified amount.
|
||||
|
||||
2013-09-27 German Arias <germanandre@gmx.es>
|
||||
|
||||
* Source/NSMenuView.m (-locationForSubmenu:): Don't change the location
|
||||
|
|
|
@ -67,6 +67,14 @@ static NSCell *verticalKnobCell = nil;
|
|||
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
|
||||
* 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.
|
||||
*/
|
||||
static CGFloat scrollerKnobOvershoot = 0.0;
|
||||
|
||||
/* This is the distance by which buttons are offset inside the scroller slot.
|
||||
*/
|
||||
|
@ -418,6 +426,14 @@ static float buttonsOffset = 1.0; // buttonsWidth = sw - 2*buttonsOffset
|
|||
{
|
||||
buttonsOffset = 1.0;
|
||||
}
|
||||
if ([defs objectForKey: @"GSScrollerKnobOvershoot"] != nil)
|
||||
{
|
||||
scrollerKnobOvershoot = [defs floatForKey: @"GSScrollerKnobOvershoot"];
|
||||
}
|
||||
else
|
||||
{
|
||||
scrollerKnobOvershoot = 0.0;
|
||||
}
|
||||
|
||||
upCell
|
||||
= [theme cellForScrollerArrow: NSScrollerDecrementArrow horizontal:NO];
|
||||
|
@ -1225,7 +1241,8 @@ static float buttonsOffset = 1.0; // buttonsWidth = sw - 2*buttonsOffset
|
|||
knobHeight = buttonsWidth;
|
||||
|
||||
/* calc knob's position */
|
||||
knobPosition = floor((float)_doubleValue * (slotHeight - knobHeight));
|
||||
knobPosition = floor((float)_doubleValue * (slotHeight - knobHeight + (2 * scrollerKnobOvershoot)))
|
||||
- scrollerKnobOvershoot;
|
||||
|
||||
if (arrowsSameEnd)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue