summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorslotwin <slotwin@users.noreply.github.com>2015-02-02 21:25:59 +0000
committerslotwin <slotwin@users.noreply.github.com>2015-02-02 21:25:59 +0000
commit46f1d269e9ab76e6fa6c04f0d5382b457b5294b5 (patch)
tree2944102f01089d2966438ab7b1ce9b6096fec924
parenta30b060978ce47d0ceb104a83acc8028658eb448 (diff)
Console: set font and colors after reloading console from options
git-svn-id: http://svn.miranda-ng.org/main/trunk@11989 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Console/src/Console.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp
index 0510f35610..fffcceddc0 100644
--- a/plugins/Console/src/Console.cpp
+++ b/plugins/Console/src/Console.cpp
@@ -91,6 +91,8 @@ static HWND hwndConsole = NULL;
static HIMAGELIST gImg = NULL;
static HFONT hfLogFont = NULL;
+static COLORREF colLogFont;
+static COLORREF colBackground;
static int gIcons = 0;
static int gVisible = 0;
@@ -828,6 +830,8 @@ static INT_PTR CALLBACK ConsoleDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
LoadSettings();
SendMessage(hwndDlg, HM_ADD, 0, 0);
PostMessage(hwndDlg, WM_SIZE, 0, 0);
+ SendMessage(hwndDlg, HM_SETFONT, (WPARAM)hfLogFont, (LPARAM)colLogFont);
+ SendMessage(hwndDlg, HM_SETCOLOR, (WPARAM)hfLogFont, (LPARAM)colBackground);
return TRUE;
}
case WM_SETFOCUS:
@@ -1090,7 +1094,6 @@ static int OnColourChange(WPARAM wParam, LPARAM lParam)
{
if (hwndConsole) {
ColourID cid = { 0 };
- COLORREF col;
cid.cbSize = sizeof(cid);
strcpy(cid.group, "Console");
@@ -1098,9 +1101,9 @@ static int OnColourChange(WPARAM wParam, LPARAM lParam)
strcpy(cid.dbSettingsGroup, "Console");
strcpy(cid.setting, "BgColor");
- col = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&cid, 0);
- if (col != -1)
- SendMessage(hwndConsole, HM_SETCOLOR, (WPARAM)hfLogFont, (LPARAM)col);
+ colBackground = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&cid, 0);
+ if (colBackground != -1)
+ SendMessage(hwndConsole, HM_SETCOLOR, (WPARAM)hfLogFont, (LPARAM)colBackground);
}
return 0;
}
@@ -1109,7 +1112,6 @@ static int OnColourChange(WPARAM wParam, LPARAM lParam)
static int OnFontChange(WPARAM wParam, LPARAM lParam)
{
if (hwndConsole) {
- COLORREF col;
HFONT hf = NULL;
LOGFONT LogFont = { 0 };
FontIDT fid = { 0 };
@@ -1118,12 +1120,12 @@ static int OnFontChange(WPARAM wParam, LPARAM lParam)
_tcsncpy(fid.group, LPGENT("Console"), SIZEOF(fid.group));
_tcsncpy(fid.name, LPGENT("Text"), SIZEOF(fid.name));
- col = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&LogFont);
+ colLogFont = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&LogFont);
if (LogFont.lfHeight != 0) {
hf = CreateFontIndirect(&LogFont);
- SendMessage(hwndConsole, HM_SETFONT, (WPARAM)hf, (LPARAM)col);
+ SendMessage(hwndConsole, HM_SETFONT, (WPARAM)hf, (LPARAM)colLogFont);
if (hfLogFont)
DeleteObject(hfLogFont);