Some more progress indicator changes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38036 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2014-08-05 02:52:03 +00:00
parent 5b0b613990
commit 98a33c53db

View file

@ -85,8 +85,6 @@
{ {
if (!_isIndeterminate && (_style == NSProgressIndicatorBarStyle)) if (!_isIndeterminate && (_style == NSProgressIndicatorBarStyle))
return; return;
if ([self isHidden] == YES)
return; // Don't update if hidden...
// Let this value overflow when it reachs the limit // Let this value overflow when it reachs the limit
_count++; _count++;
@ -128,9 +126,6 @@
&& (_style == NSProgressIndicatorBarStyle))) && (_style == NSProgressIndicatorBarStyle)))
return; return;
if ([self isHidden] && (_isDisplayedWhenStopped == YES))
return;
_isRunning = YES; _isRunning = YES;
if (!_usesThreadedAnimation) if (!_usesThreadedAnimation)
{ {
@ -165,11 +160,8 @@
// Done automatically // Done automatically
} }
#if 0
if (_isDisplayedWhenStopped == NO)
[self setHidden:YES];
#endif
_isRunning = NO; _isRunning = NO;
_count = 0;
[self setNeedsDisplay: YES]; [self setNeedsDisplay: YES];
} }
@ -178,6 +170,13 @@
return _usesThreadedAnimation; return _usesThreadedAnimation;
} }
- (BOOL)isHidden
{
if ((_isRunning == NO) && (_isDisplayedWhenStopped == NO))
return(YES);
return([super isHidden]);
}
- (void) setUsesThreadedAnimation: (BOOL)flag - (void) setUsesThreadedAnimation: (BOOL)flag
{ {
if (_usesThreadedAnimation != flag) if (_usesThreadedAnimation != flag)
@ -342,17 +341,6 @@
- (void) drawRect: (NSRect)rect - (void) drawRect: (NSRect)rect
{ {
double val; double val;
if (!_isRunning)
{
if (_isDisplayedWhenStopped == NO)
{
[[NSColor clearColor] setFill];
NSRectFill(_bounds);
}
return;
}
if (_doubleValue < _minValue) if (_doubleValue < _minValue)
val = 0.0; val = 0.0;
else if (_doubleValue > _maxValue) else if (_doubleValue > _maxValue)