Simplified the code a bit.
This commit is contained in:
parent
95dc0a87b5
commit
99bfbbbed5
|
@ -47,27 +47,22 @@ static void drawItems(struct table *t, HDC dc)
|
||||||
abort();
|
abort();
|
||||||
y = 0;
|
y = 0;
|
||||||
for (i = 0; i < 100; i++) {
|
for (i = 0; i < 100; i++) {
|
||||||
|
RECT rsel;
|
||||||
|
HBRUSH background;
|
||||||
|
|
||||||
// TODO check errors
|
// TODO check errors
|
||||||
// TODO verify correct colors
|
// TODO verify correct colors
|
||||||
|
rsel.left = r.left;
|
||||||
|
rsel.top = y;
|
||||||
|
rsel.right = r.right - r.left;
|
||||||
|
rsel.bottom = y + tm.tmHeight;
|
||||||
|
background = (HBRUSH) (COLOR_WINDOW + 1);
|
||||||
if (t->selected == i) {
|
if (t->selected == i) {
|
||||||
RECT rsel;
|
background = (HBRUSH) (COLOR_HIGHLIGHT + 1);
|
||||||
|
|
||||||
SetTextColor(dc, GetSysColor(COLOR_HIGHLIGHTTEXT));
|
SetTextColor(dc, GetSysColor(COLOR_HIGHLIGHTTEXT));
|
||||||
rsel.left = r.left;
|
} else
|
||||||
rsel.top = y;
|
|
||||||
rsel.right = r.right - r.left;
|
|
||||||
rsel.bottom = y + tm.tmHeight;
|
|
||||||
FillRect(dc, &rsel, (HBRUSH) (COLOR_HIGHLIGHT + 1));
|
|
||||||
} else {
|
|
||||||
RECT rsel;
|
|
||||||
|
|
||||||
SetTextColor(dc, GetSysColor(COLOR_WINDOWTEXT));
|
SetTextColor(dc, GetSysColor(COLOR_WINDOWTEXT));
|
||||||
rsel.left = r.left;
|
FillRect(dc, &rsel, background);
|
||||||
rsel.top = y;
|
|
||||||
rsel.right = r.right - r.left;
|
|
||||||
rsel.bottom = y + tm.tmHeight;
|
|
||||||
FillRect(dc, &rsel, (HBRUSH) (COLOR_WINDOW + 1));
|
|
||||||
}
|
|
||||||
SetBkMode(dc, TRANSPARENT);
|
SetBkMode(dc, TRANSPARENT);
|
||||||
TextOutW(dc, r.left, y, L"Item", 4);
|
TextOutW(dc, r.left, y, L"Item", 4);
|
||||||
y += tm.tmHeight;
|
y += tm.tmHeight;
|
||||||
|
|
Loading…
Reference in New Issue