diff options
Diffstat (limited to 'ping/pingthread.cpp')
-rw-r--r-- | ping/pingthread.cpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/ping/pingthread.cpp b/ping/pingthread.cpp index afbaea2..3c6b2c9 100644 --- a/ping/pingthread.cpp +++ b/ping/pingthread.cpp @@ -21,7 +21,9 @@ int frame_id = -1; HBRUSH tbrush = 0;
FontID font_id;
+ColourID bk_col_id;
HFONT hFont = 0;
+COLORREF bk_col = RGB(255, 255, 255);
////////////////
#define WinVerMajor() LOBYTE(LOWORD(GetVersion()))
@@ -393,7 +395,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar tcol = DBGetContactSettingDword(NULL,"CLC","SelTextColour", GetSysColor(COLOR_HIGHLIGHTTEXT));
SetTextColor(dis->hDC, tcol);
} else {
- tcol = options.bg_colour;
+ tcol = bk_col;
SetBkColor(dis->hDC, tcol);
FillRect(dis->hDC, &dis->rcItem, (ttbrush = CreateSolidBrush(tcol)));
@@ -435,14 +437,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar {
if(tbrush) DeleteObject(tbrush);
- return (BOOL)(tbrush = CreateSolidBrush(options.bg_colour));
+ return (BOOL)(tbrush = CreateSolidBrush(bk_col));
}
case WM_ERASEBKGND:
{
RECT r;
GetClientRect(hwnd, &r);
- if(!tbrush) tbrush = CreateSolidBrush(options.bg_colour);
+ if(!tbrush) tbrush = CreateSolidBrush(bk_col);
FillRect((HDC)wParam, &r, tbrush);
}
return TRUE;
@@ -877,13 +879,16 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar int ReloadFont(WPARAM wParam, LPARAM lParam) {
- DeleteObject(hFont);
+ if(hFont) DeleteObject(hFont);
LOGFONT log_font;
CallService(MS_FONT_GET, (WPARAM)&font_id, (LPARAM)&log_font);
hFont = CreateFontIndirect(&log_font);
SendMessage(list_hwnd, WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE);
+ bk_col = CallService(MS_COLOUR_GET, (WPARAM)&bk_col_id, 0);
+ RefreshWindow(0, 0);
+
return 0;
}
@@ -1027,19 +1032,24 @@ void InitList() { if(ServiceExists(MS_FONT_REGISTER)) {
font_id.cbSize = sizeof(FontID);
- strncpy(font_id.group, "Frames", sizeof(font_id.group));
- strncpy(font_id.name, "Ping", sizeof(font_id.name));
+ strncpy(font_id.group, "Ping", sizeof(font_id.group));
+ strncpy(font_id.name, "List", sizeof(font_id.name));
strncpy(font_id.dbSettingsGroup, "PING", sizeof(font_id.dbSettingsGroup));
strncpy(font_id.prefix, "Font", sizeof(font_id.prefix));
font_id.order = 0;
CallService(MS_FONT_REGISTER, (WPARAM)&font_id, 0);
- LOGFONT log_font;
- CallService(MS_FONT_GET, (WPARAM)&font_id, (LPARAM)&log_font);
- hFont = CreateFontIndirect(&log_font);
- SendMessage(list_hwnd, WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE);
-
+
+ bk_col_id.cbSize = sizeof(ColourID);
+ strncpy(bk_col_id.group, "Ping", sizeof(bk_col_id.group));
+ strncpy(bk_col_id.name, "Background", sizeof(bk_col_id.name));
+ strncpy(bk_col_id.dbSettingsGroup, "PING", sizeof(bk_col_id.dbSettingsGroup));
+ strncpy(bk_col_id.setting, "BgColor", sizeof(bk_col_id.setting));
+ CallService(MS_COLOUR_REGISTER, (WPARAM)&bk_col_id, 0);
+
HookEvent(ME_FONT_RELOAD, ReloadFont);
+
+ ReloadFont(0, 0);
}
start_ping_thread();
|