Added themed progressbars.
This commit is contained in:
parent
301376706f
commit
a00ca05136
|
@ -329,7 +329,7 @@ static HRESULT drawProgressBarPart(struct drawState *s)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
progress = uiprivTableProgress(s->t, s->iItem, s->iSubItem, s->p->progressBarModelColumn, &indeterminatePos);
|
progress = uiprivTableProgress(s->t, s->iItem, s->iSubItem, s->p->progressBarModelColumn, &indeterminatePos);
|
||||||
|
|
||||||
theme = OpenThemeData(s->t->hwnd, L"TODO");
|
theme = OpenThemeData(s->t->hwnd, L"PROGRESS");
|
||||||
|
|
||||||
if (GetTextMetricsW(s->dc, &tm) == 0) {
|
if (GetTextMetricsW(s->dc, &tm) == 0) {
|
||||||
logLastError(L"GetTextMetricsW()");
|
logLastError(L"GetTextMetricsW()");
|
||||||
|
@ -345,8 +345,23 @@ static HRESULT drawProgressBarPart(struct drawState *s)
|
||||||
rBorder = r;
|
rBorder = r;
|
||||||
InflateRect(&rBorder, -1, -1);
|
InflateRect(&rBorder, -1, -1);
|
||||||
if (theme != NULL) {
|
if (theme != NULL) {
|
||||||
// TODO
|
RECT crect;
|
||||||
}/* else */{
|
|
||||||
|
hr = GetThemeBackgroundContentRect(theme, s->dc,
|
||||||
|
PP_TRANSPARENTBAR, PBBS_NORMAL,
|
||||||
|
&rBorder, &crect);
|
||||||
|
if (hr != S_OK) {
|
||||||
|
logHRESULT(L"GetThemeBackgroundContentRect()", hr);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
hr = DrawThemeBackground(theme, s->dc,
|
||||||
|
PP_TRANSPARENTBAR, PBBS_NORMAL,
|
||||||
|
&crect, NULL);
|
||||||
|
if (hr != S_OK) {
|
||||||
|
logHRESULT(L"DrawThemeBackground() border", hr);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
HPEN pen, prevPen;
|
HPEN pen, prevPen;
|
||||||
HBRUSH brush, prevBrush;
|
HBRUSH brush, prevBrush;
|
||||||
|
|
||||||
|
@ -389,12 +404,18 @@ static HRESULT drawProgressBarPart(struct drawState *s)
|
||||||
rFill[0].right = rFill[0].left + pieceWidth;
|
rFill[0].right = rFill[0].left + pieceWidth;
|
||||||
}
|
}
|
||||||
for (i = 0; i < nFill; i++)
|
for (i = 0; i < nFill; i++)
|
||||||
{ if (theme != NULL) {
|
if (theme != NULL) {
|
||||||
// TODO
|
hr = DrawThemeBackground(theme, s->dc,
|
||||||
}/* else*/
|
PP_FILL, PBFS_NORMAL,
|
||||||
|
&rFill[i], NULL);
|
||||||
|
if (hr != S_OK) {
|
||||||
|
logHRESULT(L"DrawThemeBackground() fill", hr);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
} else
|
||||||
// TODO check errors
|
// TODO check errors
|
||||||
FillRect(s->dc, &rFill[i], GetSysColorBrush(sysColor));
|
FillRect(s->dc, &rFill[i], GetSysColorBrush(sysColor));
|
||||||
}
|
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
fail:
|
fail:
|
||||||
// TODO check errors
|
// TODO check errors
|
||||||
|
|
Loading…
Reference in New Issue