Progress bar optimisation.
This commit is contained in:
parent
3abbf8e1b2
commit
e2f3a68c3b
2 changed files with 28 additions and 32 deletions
|
@ -79,7 +79,6 @@ GHandle gwinGProgressbarCreate(GDisplay *g, GProgressbarObject *gs, const GWidge
|
|||
gs->pos = 0;
|
||||
|
||||
#if GWIN_PROGRESSBAR_AUTO
|
||||
gs->delay = 0;
|
||||
gtimerInit(&gs->gt);
|
||||
#endif
|
||||
|
||||
|
@ -189,8 +188,8 @@ void gwinProgressbarDecrement(GHandle gh) {
|
|||
|
||||
gwinProgressbarIncrement(gh);
|
||||
|
||||
if (gsw->pos < gsw->max)
|
||||
gtimerStart(&(gsw->gt), _progressbarCallback, gh, FALSE, gsw->delay);
|
||||
if (gsw->pos >= gsw->max)
|
||||
gtimerStop(&gsw->gt);
|
||||
|
||||
#undef gsw
|
||||
}
|
||||
|
@ -201,9 +200,7 @@ void gwinProgressbarDecrement(GHandle gh) {
|
|||
if (gh->vmt != (gwinVMT *)&progressbarVMT)
|
||||
return;
|
||||
|
||||
gsw->delay = delay;
|
||||
|
||||
gtimerStart(&(gsw->gt), _progressbarCallback, gh, FALSE, gsw->delay);
|
||||
gtimerStart(&gsw->gt, _progressbarCallback, gh, TRUE, delay);
|
||||
|
||||
#undef gsw
|
||||
}
|
||||
|
@ -214,7 +211,7 @@ void gwinProgressbarDecrement(GHandle gh) {
|
|||
if (gh->vmt != (gwinVMT *)&progressbarVMT)
|
||||
return;
|
||||
|
||||
gtimerStop(&(gsw->gt));
|
||||
gtimerStop(&gsw->gt);
|
||||
|
||||
#undef gsw
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ typedef struct GProgressbarObject {
|
|||
int pos;
|
||||
#if GWIN_PROGRESSBAR_AUTO
|
||||
GTimer gt;
|
||||
delaytime_t delay;
|
||||
#endif
|
||||
} GProgressbarObject;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue