Fixed progressbar animation issue. Re-added TODO for clipping because I can't tell how it happens anymore.

This commit is contained in:
Pietro Gagliardi 2015-08-23 23:10:17 -04:00
parent bc8d6a2fe7
commit 1ba27d325e
2 changed files with 10 additions and 3 deletions

View File

@ -5,6 +5,7 @@
// - page 2 isn't growable - I think this is because the button in the tab isn't stretchy
// - tab on page 2 is glitched
// - separators on page 4 have variable padding after them
// - 10.8: if we switch to page 4, then switch back to page 1, check Spaced, and go back to page 4, some controls (progress bar, popup button) are clipped on the sides
struct uiBox {
uiDarwinControl c;

View File

@ -1,9 +1,6 @@
// 14 august 2015
#import "uipriv_darwin.h"
// TODOs:
// - 10.8: increasing value animates just like with Aero
struct uiProgressBar {
uiDarwinControl c;
NSProgressIndicator *pi;
@ -19,6 +16,15 @@ void uiProgressBarSetValue(uiProgressBar *p, int value)
{
if (value < 0 || value > 100)
complain("value %d out of range in progressbarSetValue()", value);
// on 10.8 there's an animation when the progress bar increases, just like with Aero
if (value == 100) {
[p->pi setMaxValue:101];
[p->pi setDoubleValue:101];
[p->pi setDoubleValue:100];
[p->pi setMaxValue:100];
return;
}
[p->pi setDoubleValue:((double) (value + 1))];
[p->pi setDoubleValue:((double) value)];
}