summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/msgdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM/src/msgdialog.cpp')
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp89
1 files changed, 2 insertions, 87 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index ecab7d8cf4..34bd740ff2 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -2650,93 +2650,8 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
return Menu_DrawItem(lParam);
}
- if (dis->CtlID == IDC_SRMM_NICKLIST) {
- int x_offset = 0;
- int index = dis->itemID;
-
- USERINFO *ui = g_chatApi.UM_FindUserFromIndex(m_si, index);
- if (ui == nullptr)
- return TRUE;
-
- int height = dis->rcItem.bottom - dis->rcItem.top;
- if (height & 1)
- height++;
- int offset = (height == 10) ? 0 : height / 2;
-
- HICON hIcon = g_chatApi.SM_GetStatusIcon(m_si, ui);
- HFONT hFont = g_Settings.UserListFonts[ui->iStatusEx];
- HFONT hOldFont = (HFONT)SelectObject(dis->hDC, hFont);
- SetBkMode(dis->hDC, TRANSPARENT);
-
- int nickIndex = 0;
- for (int i = 0; i < STATUSICONCOUNT; i++) {
- if (hIcon == g_chatApi.hStatusIcons[i]) {
- nickIndex = i;
- break;
- }
- }
-
- if (dis->itemState & ODS_SELECTED) {
- FillRect(dis->hDC, &dis->rcItem, g_Settings.SelectionBGBrush);
- SetTextColor(dis->hDC, g_Settings.nickColors[6]);
- }
- else {
- FillRect(dis->hDC, &dis->rcItem, g_chatApi.hListBkgBrush);
- if (g_Settings.bColorizeNicks && nickIndex != 0)
- SetTextColor(dis->hDC, g_Settings.nickColors[nickIndex - 1]);
- else
- SetTextColor(dis->hDC, g_Settings.UserListColors[ui->iStatusEx]);
- }
- x_offset = 2;
-
- if (g_Settings.bShowContactStatus && g_Settings.bContactStatusFirst && ui->ContactStatus) {
- HICON icon = Skin_LoadProtoIcon(m_si->pszModule, ui->ContactStatus);
- DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 8, icon, 16, 16, 0, nullptr, DI_NORMAL);
- IcoLib_ReleaseIcon(icon);
- x_offset += 18;
- }
-
- if (g_Settings.bClassicIndicators) {
- char szTemp[3];
- szTemp[1] = 0;
- szTemp[0] = szIndicators[nickIndex];
- if (szTemp[0]) {
- SIZE szUmode;
- GetTextExtentPoint32A(dis->hDC, szTemp, 1, &szUmode);
- TextOutA(dis->hDC, x_offset, dis->rcItem.top, szTemp, 1);
- x_offset += szUmode.cx + 2;
- }
- else x_offset += 8;
- }
- else {
- DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 5, hIcon, 10, 10, 0, nullptr, DI_NORMAL);
- x_offset += 12;
- }
-
- if (g_Settings.bShowContactStatus && !g_Settings.bContactStatusFirst && ui->ContactStatus) {
- HICON icon = Skin_LoadProtoIcon(m_si->pszModule, ui->ContactStatus);
- DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 8, icon, 16, 16, 0, nullptr, DI_NORMAL);
- IcoLib_ReleaseIcon(icon);
- x_offset += 18;
- }
-
- SIZE sz;
- if (m_iSearchItem != -1 && m_iSearchItem == index && m_wszSearch[0]) {
- COLORREF clr_orig = GetTextColor(dis->hDC);
- GetTextExtentPoint32(dis->hDC, ui->pszNick, (int)mir_wstrlen(m_wszSearch), &sz);
- SetTextColor(dis->hDC, RGB(250, 250, 0));
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, (int)mir_wstrlen(m_wszSearch));
- SetTextColor(dis->hDC, clr_orig);
- x_offset += sz.cx;
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + mir_wstrlen(m_wszSearch), int(mir_wstrlen(ui->pszNick) - mir_wstrlen(m_wszSearch)));
- }
- else {
- GetTextExtentPoint32(dis->hDC, ui->pszNick, (int)mir_wstrlen(ui->pszNick), &sz);
- TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, (int)mir_wstrlen(ui->pszNick));
- SelectObject(dis->hDC, hOldFont);
- }
- return TRUE;
- }
+ if (dis->CtlID == IDC_SRMM_NICKLIST)
+ break;
}
return MsgWindowDrawHandler((DRAWITEMSTRUCT *)lParam);