Fixing progressbar bug
This commit is contained in:
parent
237658f052
commit
f7ef75928b
1 changed files with 25 additions and 9 deletions
|
@ -206,6 +206,12 @@ void gwinProgressbarStart(GHandle gh, delaytime_t delay) {
|
||||||
gtimerInit(&(gsw->gt));
|
gtimerInit(&(gsw->gt));
|
||||||
gtimerStart(&(gsw->gt), _progressbarCallback, gh, FALSE, gsw->delay);
|
gtimerStart(&(gsw->gt), _progressbarCallback, gh, FALSE, gsw->delay);
|
||||||
|
|
||||||
|
// if this is not made, the progressbar will not start when the it's already visible
|
||||||
|
if (gsw->w.g.flags & GWIN_FLG_VISIBLE) {
|
||||||
|
gwinSetVisible(gh, FALSE);
|
||||||
|
gwinSetVisible(gh, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
#undef gsw
|
#undef gsw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,18 +232,28 @@ void gwinProgressbarStop(GHandle gh) {
|
||||||
|
|
||||||
void gwinProgressbarDraw_Std(GWidgetObject *gw, void *param) {
|
void gwinProgressbarDraw_Std(GWidgetObject *gw, void *param) {
|
||||||
#define gsw ((GProgressbarObject *)gw)
|
#define gsw ((GProgressbarObject *)gw)
|
||||||
|
|
||||||
const GColorSet * pcol;
|
const GColorSet * pcol;
|
||||||
(void) param;
|
(void) param;
|
||||||
|
|
||||||
if (gw->g.vmt != (gwinVMT *)&progressbarVMT)
|
if (gw->g.vmt != (gwinVMT *)&progressbarVMT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// disable the auto-update timer if any
|
||||||
|
#if GFX_USE_GTIMER
|
||||||
|
if (gtimerIsActive(&(gsw->gt)) && !(gw->g.flags & GWIN_FLG_ENABLED)) {
|
||||||
|
gtimerStop(&(gsw->gt));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// get the colors right
|
||||||
if ((gw->g.flags & GWIN_FLG_ENABLED))
|
if ((gw->g.flags & GWIN_FLG_ENABLED))
|
||||||
pcol = &gw->pstyle->pressed;
|
pcol = &gw->pstyle->pressed;
|
||||||
else
|
else
|
||||||
pcol = &gw->pstyle->disabled;
|
pcol = &gw->pstyle->disabled;
|
||||||
|
|
||||||
if (gw->g.width < gw->g.height) { // Vertical progressbar
|
// Vertical progressbar
|
||||||
|
if (gw->g.width < gw->g.height) {
|
||||||
if (gsw->dpos != gw->g.height-1)
|
if (gsw->dpos != gw->g.height-1)
|
||||||
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y+gsw->dpos, gw->g.width, gw->g.height - gsw->dpos, pcol->progress); // Active Area
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y+gsw->dpos, gw->g.width, gw->g.height - gsw->dpos, pcol->progress); // Active Area
|
||||||
if (gsw->dpos != 0)
|
if (gsw->dpos != 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue