comctl32: Stop flicker when drawing themed and draw the correct image smoothly.

oldstable
André Hentschel 2009-07-26 15:57:06 +02:00 committed by Alexandre Julliard
parent b4c5a62338
commit b585ca0f64
1 changed files with 5 additions and 21 deletions

View File

@ -263,38 +263,22 @@ static const ProgressDrawProc drawProcClassic[8] = {
static void draw_theme_bar_H (const ProgressDrawInfo* di, int start, int end)
{
RECT r;
int right = di->rect.left + end;
r.left = di->rect.left + start;
r.top = di->rect.top;
r.bottom = di->rect.bottom;
while (r.left < right)
{
r.right = min (r.left + di->ledW, right);
DrawThemeBackground (di->theme, di->hdc, PP_CHUNK, 0, &r, NULL);
r.left = r.right;
r.right = min (r.left + di->ledGap, right);
DrawThemeBackground (di->theme, di->hdc, PP_BAR, 0, &di->bgRect, &r);
r.left = r.right;
}
r.right = di->rect.left + end;
DrawThemeBackground (di->theme, di->hdc, PP_CHUNK, 0, &r, NULL);
}
/* draw themed horizontal bar from 'start' to 'end' */
/* draw themed vertical bar from 'start' to 'end' */
static void draw_theme_bar_V (const ProgressDrawInfo* di, int start, int end)
{
RECT r;
int top = di->rect.bottom - end;
r.left = di->rect.left;
r.right = di->rect.right;
r.bottom = di->rect.bottom - start;
while (r.bottom > top)
{
r.top = max (r.bottom - di->ledW, top);
DrawThemeBackground (di->theme, di->hdc, PP_CHUNKVERT, 0, &r, NULL);
r.bottom = r.top;
r.top = max (r.bottom - di->ledGap, top);
DrawThemeBackground (di->theme, di->hdc, PP_BARVERT, 0, &di->bgRect, &r);
r.bottom = r.top;
}
r.top = di->rect.bottom - end;
DrawThemeBackground (di->theme, di->hdc, PP_CHUNKVERT, 0, &r, NULL);
}
/* draw themed horizontal background from 'start' to 'end' */