mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 16:10:55 +00:00
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:
parent
5b0b613990
commit
98a33c53db
1 changed files with 16 additions and 28 deletions
|
@ -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++;
|
||||||
|
@ -127,10 +125,7 @@
|
||||||
if (_isRunning || (!_isIndeterminate
|
if (_isRunning || (!_isIndeterminate
|
||||||
&& (_style == NSProgressIndicatorBarStyle)))
|
&& (_style == NSProgressIndicatorBarStyle)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ([self isHidden] && (_isDisplayedWhenStopped == YES))
|
|
||||||
return;
|
|
||||||
|
|
||||||
_isRunning = YES;
|
_isRunning = YES;
|
||||||
if (!_usesThreadedAnimation)
|
if (!_usesThreadedAnimation)
|
||||||
{
|
{
|
||||||
|
@ -151,9 +146,9 @@
|
||||||
|
|
||||||
- (void) stopAnimation: (id)sender
|
- (void) stopAnimation: (id)sender
|
||||||
{
|
{
|
||||||
if (!_isRunning || (!_isIndeterminate
|
if (!_isRunning || (!_isIndeterminate
|
||||||
&& (_style == NSProgressIndicatorBarStyle)))
|
&& (_style == NSProgressIndicatorBarStyle)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
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,28 +341,17 @@
|
||||||
- (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)
|
||||||
val = 1.0;
|
val = 1.0;
|
||||||
else
|
else
|
||||||
val = (_doubleValue - _minValue) / (_maxValue - _minValue);
|
val = (_doubleValue - _minValue) / (_maxValue - _minValue);
|
||||||
[[GSTheme theme] drawProgressIndicator: self
|
[[GSTheme theme] drawProgressIndicator: self
|
||||||
withBounds: _bounds
|
withBounds: _bounds
|
||||||
withClip: rect
|
withClip: rect
|
||||||
atCount: _count
|
atCount: _count
|
||||||
forValue: val];
|
forValue: val];
|
||||||
}
|
}
|
||||||
|
|
||||||
// It does not seem that Gnustep has a copyWithZone: on NSView, it is private
|
// It does not seem that Gnustep has a copyWithZone: on NSView, it is private
|
||||||
|
|
Loading…
Reference in a new issue