summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-19 14:02:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-19 14:02:37 +0000
commit1541d27e5a23f2fa680d129603a73420483c7689 (patch)
treeb6bfd1df9d175d4f8675c9548fb9b898469266f0 /src/modules
parent9e28cb9292146942a0eccc0712ee80fb83f5b2d7 (diff)
fix for dynamic fonts registering
git-svn-id: http://svn.miranda-ng.org/main/trunk@7758 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/chat/chat.h2
-rw-r--r--src/modules/chat/chat_opts.cpp30
-rw-r--r--src/modules/chat/manager.cpp4
3 files changed, 22 insertions, 14 deletions
diff --git a/src/modules/chat/chat.h b/src/modules/chat/chat.h
index 6fdfca7202..57e940de54 100644
--- a/src/modules/chat/chat.h
+++ b/src/modules/chat/chat.h
@@ -37,7 +37,7 @@ struct GCPTRS
extern HGENMENU hJoinMenuItem, hLeaveMenuItem;
extern GlobalLogSettingsBase *g_Settings;
-extern int g_cbSession, g_cbModuleInfo;
+extern int g_cbSession, g_cbModuleInfo, g_iFontMode, g_iChatLang;
extern TCHAR *g_szFontGroup;
extern CRITICAL_SECTION cs;
diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp
index 5396d94f5b..5d4656231d 100644
--- a/src/modules/chat/chat_opts.cpp
+++ b/src/modules/chat/chat_opts.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern SESSION_INFO g_TabSession;
GlobalLogSettingsBase *g_Settings;
-int g_cbSession, g_cbModuleInfo;
+int g_cbSession, g_cbModuleInfo, g_iFontMode, g_iChatLang;
TCHAR *g_szFontGroup;
#define FONTF_BOLD 1
@@ -39,10 +39,6 @@ struct FontOptionsList
LPCTSTR szDefFace;
BYTE defCharset, defStyle;
char defSize;
- COLORREF colour;
- LPCTSTR szFace;
- BYTE charset, style;
- char size;
}
//remeber to put these in the Translate( ) template file too
@@ -64,7 +60,7 @@ static const fontOptionsList[] = {
{ LPGENT("User disables status for ..."), RGB(150, 70, 70), _T("Verdana"), DEFAULT_CHARSET, 0, -12 },
{ LPGENT("Action message"), RGB(160, 90, 160), _T("Verdana"), DEFAULT_CHARSET, 0, -12 },
{ LPGENT("Highlighted message"), RGB(180, 150, 80), _T("Verdana"), DEFAULT_CHARSET, 0, -12 },
- { LPGENT("Message typing area"), RGB(0, 0, 40), _T("Verdana"), DEFAULT_CHARSET, 0, -12 },
+ { _T(""), 0, _T("Verdana"), DEFAULT_CHARSET, 0, -12 },
{ LPGENT("User list members (online)"), RGB(0, 0, 0), _T("Verdana"), DEFAULT_CHARSET, 0, -12 },
{ LPGENT("User list members (away)"), RGB(170, 170, 170), _T("Verdana"), DEFAULT_CHARSET, 0, -12 }
};
@@ -151,18 +147,28 @@ void RegisterFonts(void)
_tcsncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, SIZEOF(fontid.deffontsettings.szFace));
_tcsncpy(fontid.backgroundGroup, g_szFontGroup, SIZEOF(fontid.backgroundGroup));
switch (i) {
- case 17:
- _tcsncpy_s(fontid.backgroundName, SIZEOF(fontid.backgroundName), _T("Message background"), _TRUNCATE);
- break;
case 18:
case 19:
- _tcsncpy_s(fontid.backgroundName, SIZEOF(fontid.backgroundName), _T("Userlist background"), _TRUNCATE);
+ _tcsncpy_s(fontid.backgroundName, SIZEOF(fontid.backgroundName), LPGENT("Userlist background"), _TRUNCATE);
break;
+ case 17:
+ if (g_iFontMode == FONTMODE_SKIP)
+ continue;
+ if (g_iFontMode == FONTMODE_USE) {
+ _tcsncpy_s(fontid.name, SIZEOF(fontid.name), LPGENT("Message typing area"), _TRUNCATE);
+ _tcsncpy_s(fontid.backgroundName, SIZEOF(fontid.backgroundName), LPGENT("Message background"), _TRUNCATE);
+ fontid.deffontsettings.colour = RGB(0, 0, 40);
+ break;
+ }
+
+ _tcsncpy_s(fontid.name, SIZEOF(fontid.name), LPGENT("Chat log symbols (Webdings)"), _TRUNCATE);
+ fontid.deffontsettings.colour = RGB(170, 170, 170);
+ // fall through
default:
- _tcsncpy_s(fontid.backgroundName, SIZEOF(fontid.backgroundName), _T("Group chat log background"), _TRUNCATE);
+ _tcsncpy_s(fontid.backgroundName, SIZEOF(fontid.backgroundName), LPGENT("Group chat log background"), _TRUNCATE);
break;
}
- FontRegisterT(&fontid);
+ CallService("Font/RegisterW", (WPARAM)&fontid, g_iChatLang);
}
}
diff --git a/src/modules/chat/manager.cpp b/src/modules/chat/manager.cpp
index d12f27036b..a840f1a248 100644
--- a/src/modules/chat/manager.cpp
+++ b/src/modules/chat/manager.cpp
@@ -1337,7 +1337,7 @@ static BOOL LM_RemoveAll(LOGINFO** ppLogListStart, LOGINFO** ppLogListEnd)
return TRUE;
}
-INT_PTR SvcGetChatManager(WPARAM, LPARAM lParam)
+INT_PTR SvcGetChatManager(WPARAM wParam, LPARAM lParam)
{
// wipe out old junk
memset(PBYTE(&ci) + offsetof(CHAT_MANAGER, OnCreateModule), 0, sizeof(CHAT_MANAGER)-offsetof(CHAT_MANAGER, OnCreateModule));
@@ -1379,6 +1379,8 @@ INT_PTR SvcGetChatManager(WPARAM, LPARAM lParam)
g_szFontGroup = pInit->szFontGroup;
g_cbSession = pInit->cbSession;
g_cbModuleInfo = pInit->cbModuleInfo;
+ g_iFontMode = pInit->iFontMode;
+ g_iChatLang = (int)wParam;
ci.SetActiveSession = SetActiveSession;
ci.SetActiveSessionEx = SetActiveSessionEx;