Make sure we repopulate cached parts when needed.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27537 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-01-06 16:58:07 +00:00
parent 3dd7a35157
commit 33b3166d05

View file

@ -933,6 +933,11 @@ static const float buttonsOffset = 2; // buttonsWidth = sw - buttonsOffset
static NSRect rectForPartDecrementLine; static NSRect rectForPartDecrementLine;
static NSRect rectForPartKnobSlot; static NSRect rectForPartKnobSlot;
if (upCell == nil)
{
[self drawParts];
[self checkSpaceForParts];
}
if (_cacheValid == NO) if (_cacheValid == NO)
{ {
rectForPartIncrementLine = [self rectForPart: NSScrollerIncrementLine]; rectForPartIncrementLine = [self rectForPart: NSScrollerIncrementLine];
@ -975,6 +980,11 @@ static const float buttonsOffset = 2; // buttonsWidth = sw - buttonsOffset
(whichButton == NSScrollerIncrementArrow ? "increment" : "decrement"), (whichButton == NSScrollerIncrementArrow ? "increment" : "decrement"),
rect.origin.x, rect.origin.y); rect.origin.x, rect.origin.y);
if (upCell == nil)
{
[self drawParts];
[self checkSpaceForParts];
}
switch (whichButton) switch (whichButton)
{ {
case NSScrollerDecrementArrow: case NSScrollerDecrementArrow:
@ -993,6 +1003,11 @@ static const float buttonsOffset = 2; // buttonsWidth = sw - buttonsOffset
*/ */
- (void) drawKnob - (void) drawKnob
{ {
if (upCell == nil)
{
[self drawParts];
[self checkSpaceForParts];
}
if (_isHorizontal) if (_isHorizontal)
[horizontalKnobCell drawWithFrame: [self rectForPart: NSScrollerKnob] [horizontalKnobCell drawWithFrame: [self rectForPart: NSScrollerKnob]
inView: self]; inView: self];
@ -1005,6 +1020,11 @@ static const float buttonsOffset = 2; // buttonsWidth = sw - buttonsOffset
{ {
static NSRect rect; static NSRect rect;
if (upCell == nil)
{
[self drawParts];
[self checkSpaceForParts];
}
if (_cacheValid == NO) if (_cacheValid == NO)
{ {
rect = [self rectForPart: NSScrollerKnobSlot]; rect = [self rectForPart: NSScrollerKnobSlot];
@ -1051,6 +1071,11 @@ static const float buttonsOffset = 2; // buttonsWidth = sw - buttonsOffset
NSInterfaceStyle interfaceStyle = NSInterfaceStyleForKey(@"NSScrollerInterfaceStyle",self); NSInterfaceStyle interfaceStyle = NSInterfaceStyleForKey(@"NSScrollerInterfaceStyle",self);
if (upCell == nil)
{
[self drawParts];
[self checkSpaceForParts];
}
/* We use the button offset if we in the NeXTstep interface style. */ /* We use the button offset if we in the NeXTstep interface style. */
if (interfaceStyle == NSNextStepInterfaceStyle if (interfaceStyle == NSNextStepInterfaceStyle
|| interfaceStyle == GSWindowMakerInterfaceStyle) || interfaceStyle == GSWindowMakerInterfaceStyle)