Adds indeterminate progressbar to darwin (not yet tested)

This commit is contained in:
emersion 2016-06-16 09:45:08 +02:00
parent 7770b5c850
commit cff5dcf9c9
1 changed files with 21 additions and 0 deletions

View File

@ -27,10 +27,31 @@ struct uiProgressBar {
uiDarwinControlAllDefaults(uiProgressBar, pi)
int uiProgressBarValue(uiProgressBar *p)
{
if ([p->pi getIndeterminate]) {
return -1;
}
return (int) [p->pi getDoubleValue];
}
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)
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
if (value == 100) {
[p->pi setMaxValue:101];