diff options
Diffstat (limited to 'plugins/Scriver/src/msgutils.cpp')
-rw-r--r-- | plugins/Scriver/src/msgutils.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp index 4f7223c28d..b982bc5326 100644 --- a/plugins/Scriver/src/msgutils.cpp +++ b/plugins/Scriver/src/msgutils.cpp @@ -36,6 +36,44 @@ void CMsgDialog::CloseTab() Close(); } +void CMsgDialog::DrawNickList(USERINFO *ui, DRAWITEMSTRUCT *dis) +{ + int x_offset = 2; + + int height = dis->rcItem.bottom - dis->rcItem.top; + if (height & 1) + height++; + + int offset = (height == 10) ? 0 : height / 2 - 5; + HFONT hFont = (ui->iStatusEx == 0) ? g_Settings.UserListFont : g_Settings.UserListHeadingsFont; + HFONT hOldFont = (HFONT)SelectObject(dis->hDC, hFont); + SetBkMode(dis->hDC, TRANSPARENT); + + if (dis->itemAction == ODA_FOCUS && dis->itemState & ODS_SELECTED) + FillRect(dis->hDC, &dis->rcItem, g_chatApi.hListSelectedBkgBrush); + else //if (dis->itemState & ODS_INACTIVE) + FillRect(dis->hDC, &dis->rcItem, g_chatApi.hListBkgBrush); + + if (g_Settings.bShowContactStatus && g_Settings.bContactStatusFirst && ui->ContactStatus) { + HICON hIcon = Skin_LoadProtoIcon(m_si->pszModule, ui->ContactStatus); + DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 3, hIcon, 16, 16, 0, nullptr, DI_NORMAL); + IcoLib_ReleaseIcon(hIcon); + x_offset += 18; + } + DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset, g_chatApi.SM_GetStatusIcon(m_si, ui), 10, 10, 0, nullptr, DI_NORMAL); + x_offset += 12; + if (g_Settings.bShowContactStatus && !g_Settings.bContactStatusFirst && ui->ContactStatus) { + HICON hIcon = Skin_LoadProtoIcon(m_si->pszModule, ui->ContactStatus); + DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 3, hIcon, 16, 16, 0, nullptr, DI_NORMAL); + IcoLib_ReleaseIcon(hIcon); + x_offset += 18; + } + + SetTextColor(dis->hDC, ui->iStatusEx == 0 ? g_Settings.crUserListColor : g_Settings.crUserListHeadingsColor); + TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, (int)mir_wstrlen(ui->pszNick)); + SelectObject(dis->hDC, hOldFont); +} + void CMsgDialog::EventAdded(MEVENT hDbEvent, const DBEVENTINFO &dbei) { if (m_hDbEventFirst == 0) |