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))
return;
if ([self isHidden] == YES)
return; // Don't update if hidden...
// Let this value overflow when it reachs the limit
_count++;
@ -127,10 +125,7 @@
if (_isRunning || (!_isIndeterminate
&& (_style == NSProgressIndicatorBarStyle)))
return;
if ([self isHidden] && (_isDisplayedWhenStopped == YES))
return;
_isRunning = YES;
if (!_usesThreadedAnimation)
{
@ -151,9 +146,9 @@
- (void) stopAnimation: (id)sender
{
if (!_isRunning || (!_isIndeterminate
if (!_isRunning || (!_isIndeterminate
&& (_style == NSProgressIndicatorBarStyle)))
return;
return;
if (!_usesThreadedAnimation)
{
@ -165,11 +160,8 @@
// Done automatically
}
#if 0
if (_isDisplayedWhenStopped == NO)
[self setHidden:YES];
#endif
_isRunning = NO;
_count = 0;
[self setNeedsDisplay: YES];
}
@ -178,6 +170,13 @@
return _usesThreadedAnimation;
}
- (BOOL)isHidden
{
if ((_isRunning == NO) && (_isDisplayedWhenStopped == NO))
return(YES);
return([super isHidden]);
}
- (void) setUsesThreadedAnimation: (BOOL)flag
{
if (_usesThreadedAnimation != flag)
@ -342,28 +341,17 @@
- (void) drawRect: (NSRect)rect
{
double val;
if (!_isRunning)
{
if (_isDisplayedWhenStopped == NO)
{
[[NSColor clearColor] setFill];
NSRectFill(_bounds);
}
return;
}
if (_doubleValue < _minValue)
val = 0.0;
else if (_doubleValue > _maxValue)
val = 1.0;
else
val = (_doubleValue - _minValue) / (_maxValue - _minValue);
[[GSTheme theme] drawProgressIndicator: self
withBounds: _bounds
withClip: rect
atCount: _count
forValue: val];
[[GSTheme theme] drawProgressIndicator: self
withBounds: _bounds
withClip: rect
atCount: _count
forValue: val];
}
// It does not seem that Gnustep has a copyWithZone: on NSView, it is private