khui_credwnd_outline * o;
int selected = 0;
khm_int32 idf = 0;
+ khui_credwnd_ident * cwi = NULL;
/* each header consists of a couple of widgets and some text */
/* we need to figure out the background color first */
khm_handle ident = o->data;
kcdb_identity_get_flags(ident, &idf);
+ cwi = cw_find_ident(tbl, ident);
}
selected = o->flags & KHUI_CW_O_SELECTED;
hbr = tbl->hb_hdr_bg_crit_s;
else if ((o->flags & CW_EXPSTATE_MASK) == CW_EXPSTATE_WARN)
hbr = tbl->hb_hdr_bg_warn_s;
- else if ((colattr == KCDB_ATTR_ID_NAME) && !(o->flags & KHUI_CW_O_EMPTY))
+ else if ((colattr == KCDB_ATTR_ID_NAME) && !(o->flags & KHUI_CW_O_EMPTY) &&
+ cwi && cwi->id_credcount > 0)
hbr = tbl->hb_hdr_bg_cred_s;
else
hbr = tbl->hb_hdr_bg_s;
hbr = tbl->hb_hdr_bg_crit;
else if ((o->flags & CW_EXPSTATE_MASK) == CW_EXPSTATE_WARN)
hbr = tbl->hb_hdr_bg_warn;
- else if ((colattr == KCDB_ATTR_ID_NAME) && !(o->flags & KHUI_CW_O_EMPTY))
+ else if ((colattr == KCDB_ATTR_ID_NAME) && !(o->flags & KHUI_CW_O_EMPTY) &&
+ cwi && cwi->id_credcount > 0)
hbr = tbl->hb_hdr_bg_cred;
else
hbr = tbl->hb_hdr_bg;
} else {
khui_ilist_draw_id(tbl->ilist,
- ((o->flags & KHUI_CW_O_EMPTY)?
+ (((o->flags & KHUI_CW_O_EMPTY) ||
+ cwi == NULL || cwi->id_credcount == 0)?
IDB_ID_DIS_SM:
IDB_ID_SM),
hdc,
wchar_t typestr[128];
int cx_id;
SIZE size;
- khui_credwnd_ident * cwi;
/* expanded view */
#ifdef DEBUG
assert(colattr == KCDB_ATTR_ID_NAME);
#endif
- cwi = cw_find_ident(tbl, o->data);
-
CopyRect(&tr, r);
tr.bottom -= (tr.bottom - tr.top) / 2; /* drawing two lines of text */
{
khui_credwnd_tbl * tbl;
khm_handle ident;
- khm_size i;
size_t count = 0;
COLORREF old_clr;
wchar_t * cap;
assert(cap != NULL);
#endif
- for (i=0; i < tbl->n_idents; i++) {
- if (kcdb_identity_is_equal(tbl->idents[i].ident, ident)) {
- count = tbl->idents[i].credcount;
- break;
+ {
+ khui_credwnd_ident * cwi;
+
+ cwi = cw_find_ident(tbl, ident);
+ if (cwi) {
+ count = cwi->id_credcount;
+ } else {
+ count = 0;
}
}
if (lpd->itemState & (ODS_HOTLIGHT | ODS_SELECTED)) {
hbr = GetSysColorBrush(COLOR_HIGHLIGHT);
text_clr = GetSysColor(COLOR_HIGHLIGHTTEXT);
- } else if (count == 0) {
- hbr = tbl->hb_hdr_bg;
} else if (expflags == CW_EXPSTATE_EXPIRED) {
hbr = tbl->hb_hdr_bg_exp;
} else if (expflags == CW_EXPSTATE_WARN) {
hbr = tbl->hb_hdr_bg_warn;
} else if (expflags == CW_EXPSTATE_CRITICAL) {
hbr = tbl->hb_hdr_bg_crit;
- } else {
+ } else if (count > 0) {
hbr = tbl->hb_hdr_bg_cred;
+ } else {
+ hbr = tbl->hb_hdr_bg;
}
FillRect(lpd->hDC, &lpd->rcItem, hbr);