Adds indeterminate progressbar to darwin (not yet tested)
This commit is contained in:
parent
7770b5c850
commit
cff5dcf9c9
|
@ -27,10 +27,31 @@ struct uiProgressBar {
|
||||||
|
|
||||||
uiDarwinControlAllDefaults(uiProgressBar, pi)
|
uiDarwinControlAllDefaults(uiProgressBar, pi)
|
||||||
|
|
||||||
|
int uiProgressBarValue(uiProgressBar *p)
|
||||||
|
{
|
||||||
|
if ([p->pi getIndeterminate]) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (int) [p->pi getDoubleValue];
|
||||||
|
}
|
||||||
|
|
||||||
void uiProgressBarSetValue(uiProgressBar *p, int value)
|
void uiProgressBarSetValue(uiProgressBar *p, int value)
|
||||||
{
|
{
|
||||||
|
if (value == -1) {
|
||||||
|
[p->pi setIndeterminate:YES];
|
||||||
|
[p->pi startAnimation:p->pi];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([p->pi getIndeterminate]) {
|
||||||
|
[p->pi setIndeterminate:NO];
|
||||||
|
[p->pi stopAnimation:p->pi];
|
||||||
|
}
|
||||||
|
|
||||||
if (value < 0 || value > 100)
|
if (value < 0 || value > 100)
|
||||||
userbug("Value %d out of range for a uiProgressBar.", value);
|
userbug("Value %d out of range for a uiProgressBar.", value);
|
||||||
|
|
||||||
// on 10.8 there's an animation when the progress bar increases, just like with Aero
|
// on 10.8 there's an animation when the progress bar increases, just like with Aero
|
||||||
if (value == 100) {
|
if (value == 100) {
|
||||||
[p->pi setMaxValue:101];
|
[p->pi setMaxValue:101];
|
||||||
|
|
Loading…
Reference in New Issue